简体   繁体   English

SSL java.security.NoSuchAlgorithmException

[英]SSL java.security.NoSuchAlgorithmException

Java says that in this line, the file ssc.store was not found: Java说在这一行中,找不到文件ssc.store:

server = ((SSLServerSocketFactory) SSLServerSocketFactory.getDefault()).createServerSocket(port);

(server is a ServerSocket) (服务器是一个ServerSocket)

I try to use a libary containing this code, but I am not able to open this ServerSocket. 我尝试使用包含此代码的库,但无法打开此ServerSocket。

Full Error 完全错误

Error opening ServerSocket
java.net.SocketException: java.security.NoSuchAlgorithmException: Error 
constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
at javax.net.ssl.DefaultSSLServerSocketFactory.throwException(Unknown Source)
at javax.net.ssl.DefaultSSLServerSocketFactory.createServerSocket(Unknown Source)
at com.blogspot.debukkitsblog.Net.Server.start(Server.java:327)
at com.blogspot.debukkitsblog.Net.Server.<init>(Server.java:86)
at com.blogspot.debukkitsblog.Net.Server.<init>(Server.java:51)
at de.yee.GameServer.<init>(GameServer.java:16)
at de.yee.Main.main(Main.java:9)
Caused by: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
at java.security.Provider$Service.newInstance(Unknown Source)
at sun.security.jca.GetInstance.getInstance(Unknown Source)
at sun.security.jca.GetInstance.getInstance(Unknown Source)
at javax.net.ssl.SSLContext.getInstance(Unknown Source)
at javax.net.ssl.SSLContext.getDefault(Unknown Source)
at javax.net.ssl.SSLServerSocketFactory.getDefault(Unknown Source)
... 5 more
Caused by: java.security.PrivilegedActionException: java.io.FileNotFoundException: ssc.store (Das System kann die angegebene Datei nicht finden)
at java.security.AccessController.doPrivileged(Native Method)
at sun.security.ssl.SSLContextImpl$DefaultManagersHolder.getKeyManagers(Unknown Source)
at sun.security.ssl.SSLContextImpl$DefaultManagersHolder.<clinit>(Unknown Source)
at sun.security.ssl.SSLContextImpl$DefaultSSLContext.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
... 11 more
Caused by: java.io.FileNotFoundException: ssc.store (Das System kann die angegebene Datei nicht finden)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.security.ssl.SSLContextImpl$DefaultManagersHolder$2.run(Unknown Source)
at sun.security.ssl.SSLContextImpl$DefaultManagersHolder$2.run(Unknown Source)
... 19 more

What is the problem? 问题是什么?

You need ssc.store file in the working directory where you run your code. 您需要在运行代码的工作目录中的ssc.store文件。 The store is here: https://github.com/DeBukkIt/SimpleServerClient/blob/master/ssc.store (or in the specific branch or tag you checked out). 商店在这里: https : //github.com/DeBukkIt/SimpleServerClient/blob/master/ssc.store (或在您签出的特定分支或标记中)。

For example, if you're running main method inside IntelliJ, the store file should be in the project root directory. 例如,如果您在IntelliJ中运行main方法,则存储文件应位于项目根目录中。 Or, if you pack your application into a jar and run java -jar yourapp.jar , the ssc.store should be in the same directory as the jar file. 或者,如果将应用程序打包到jar并运行java -jar yourapp.jar ,则ssc.store应该与jar文件位于同一目录中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Java和SSL - java.security.NoSuchAlgorithmException - Java and SSL - java.security.NoSuchAlgorithmException Java / SSL - Unhandle异常:java.security.NoSuchAlgorithmException - Java/SSL - Unhandle exception:java.security.NoSuchAlgorithmException java.security.NoSuchAlgorithmException:SSL_TLSv2 SSLContext 不可用 - java.security.NoSuchAlgorithmException: SSL_TLSv2 SSLContext not available java.security.NoSuchAlgorithmException: RSA 签名不可用 - java.security.NoSuchAlgorithmException: RSA Signature not available java.security.NoSuchAlgorithmException:为SSLContext配置的类 - java.security.NoSuchAlgorithmException: class configured for SSLContext Tomcat 7 + MyFaces 2.1:java.security.NoSuchAlgorithmException - Tomcat 7 + MyFaces 2.1 : java.security.NoSuchAlgorithmException Java 9使用“java.security.NoSuchAlgorithmException:SHA3-384 MessageDigest不可用” - “java.security.NoSuchAlgorithmException: SHA3-384 MessageDigest not available” with Java 9 junit java.security.NoSuchAlgorithmException:找不到任何支持的提供程序 - junit java.security.NoSuchAlgorithmException: Cannot find any provider supporting java.security.NoSuchAlgorithmException:算法PBKDF2WithHmacSHA1不可用 - java.security.NoSuchAlgorithmException: Algorithm PBKDF2WithHmacSHA1 not available java.security.NoSuchAlgorithmException:未找到签名MD5WITHRSA实现 - java.security.NoSuchAlgorithmException: Signature MD5WITHRSA implementation not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM