0
我越來越NoSuchAlgorithmException
下面的代碼:拋出:NoSuchAlgorithmException在SSLContext.getInstance
@RunWith(PowerMockRunner.class)
@PrepareForTest({CloudWatchHelper.class})
class MyTest {
....
final SSLContext sslcontext = SSLContext.getInstance("TLS");
...
}
堆棧跟蹤:
[junit] class configured for SSLContext: sun.security.ssl.SSLContextImpl$TLSContext not a SSLContext
[junit] java.security.NoSuchAlgorithmException: class configured for SSLContext: sun.security.ssl.SSLContextImpl$TLSContext not a SSLContext
[junit] at sun.security.jca.GetInstance.checkSuperClass(GetInstance.java:260)
[junit] at sun.security.jca.GetInstance.getInstance(GetInstance.java:237)
[junit] at sun.security.jca.GetInstance.getInstance(GetInstance.java:164)
[junit] at javax.net.ssl.SSLContext.getInstance(SSLContext.java:156)
我想知道背後是什麼NoSuchAlgorithmException
的原因。
你搞砸了你的security.providers文件。 – EJP
你使用了什麼JRE?什麼-Djavax.net.debug =都提供了什麼? – siom
@siom Java™SE運行時環境(內部版本1.8.0_144-b01) – doptimusprime