虽然我试图在没有SSL的情况下在端口25上发送电子邮件,但我收到了SSLHandshakeException.您可以在下面看到javax.mail.Session打印的调试消息和SSLHandshakeException.
你能帮我理解发生了什么吗?
22 Dec 2009 15:13:21,054 INFO root:197 - DEBUG: setDebug: JavaMail version 1.4ea 22 Dec 2009 15:13:21,059 INFO root:197 - DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc] 22 Dec 2009 15:13:21,103 INFO root:197 - DEBUG SMTP: useEhlo true, useAuth false 22 Dec 2009 15:13:21,103 INFO root:197 - DEBUG SMTP: trying to connect to host "mail.abcdef.com", port 25, isSSL false 22 Dec 2009 15:13:21,338 INFO root:197 - 220 mail.uvwxyz.com ESMTP abcdef Mail Server v8.0; Tue, 22 Dec 2009 15:12:10 -0700 22 …
我试图使用HttpsURLConnection,然后执行PUT请求与网站建立HTTPS连接.当我尝试创建OutputStreamWriterfrom时HttpsURLConnection.getOutputStream(),抛出以下异常:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
Run Code Online (Sandbox Code Playgroud)
该页面刚刚获得了证书(由StartCom发布) - 我是否需要手动执行某些操作以使Java识别证书现在存在?我可以毫无困难地连接到同一网站的其他页面,但他们有不同的证书.
我正在编写一个Java客户端(在weblogic 10.3上)来调用安全的Web服务.我已经提供了我在cacerts中安装的客户端证书,DemoIdentity.jks和DemoTrust,jks在我的weblogic中,我已经将密钥库设置为DemoIdentity和DemoTrust.在weblogic控制台中,我将"双向客户端证书行为:"设置为"请求但未强制执行的客户端证书".并为"启用SSL侦听端口:"我已选中复选框.
我在尝试访问Web服务时遇到以下异常:
] FaultActor [null] Detail [<detail><bea_fault:stacktrace xmlns:bea_fault="http:
//www.bea.com/servers/wls70/webservice/fault/1.0.0">javax.net.ssl.SSLHandshakeEx
ception: [Security:090497]HANDSHAKE_FAILURE alert received from ************** Check both sides of the SSL configuration for mismatches in supported ciphers, supported protocol versions, trusted CAs, and hos
tname verification settings.
at com.certicom.tls.interfaceimpl.TLSConnectionImpl.fireException(Unknow
n Source)
at com.certicom.tls.interfaceimpl.TLSConnectionImpl.fireAlertReceived(Un
known Source)
at com.certicom.tls.record.alert.AlertHandler.handle(Unknown Source)
at com.certicom.tls.record.alert.AlertHandler.handleAlertMessages(Unknow
n Source)
at com.certicom.tls.record.MessageInterpreter.interpretContent(Unknown S
ource)
at com.certicom.tls.record.MessageInterpreter.decryptMessage(Unknown Sou
rce)
at com.certicom.tls.record.ReadHandler.processRecord(Unknown Source)
at com.certicom.tls.record.ReadHandler.readRecord(Unknown Source)
at com.certicom.tls.record.ReadHandler.readUntilHandshakeComplete(Unknow
n Source)
at com.certicom.tls.interfaceimpl.TLSConnectionImpl.completeHandshake(Un
known Source)
at com.certicom.tls.record.WriteHandler.write(Unknown Source)
at com.certicom.io.OutputSSLIOStreamWrapper.write(Unknown …Run Code Online (Sandbox Code Playgroud) 我从http://sanjaal.com/java/tag/get-public-key-of-ssl-certificate-in-java/获得以下代码,用于创建套接字并启动ssl握手.
SSLSocketFactory factory = HttpsURLConnection
.getDefaultSSLSocketFactory();
System.out.println("Creating a SSL Socket For "+hostname+" on port "+port);
SSLSocket socket = (SSLSocket) factory.createSocket(hostname, port);
socket.startHandshake();
System.out.println("Handshaking Complete");
Run Code Online (Sandbox Code Playgroud)
问题是如果握手无法建立,在看到异常之前需要很长的等待时间:连接超时
如何设置最长等待时间?什么是确保我ssl握手不会成功的最短时间.
我的Java程序通过java.net.http.HttpClient(Java 11)发送请求。
当我在OpenJDK 11的JRE上的Eclipse中运行它时,它可以工作。
在自定义Jlink JRE上,出现错误:
java.io.IOException: Received fatal alert: handshake_failure
Run Code Online (Sandbox Code Playgroud)
我想问题出在我的自定义JRE上。
我刚刚在我的Windows机器上安装了一个新的jenkins 2.77实例,运行Java 1.8.0#60.
我期待有一些默认插件,但似乎没有在创建实例时安装.
当我去检查可用的插件选项卡时,它显示为:
Update information obtained: N/A ago
当我点击"立即检查"按钮时,我收到以下堆栈跟踪错误:
堆栈跟踪:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
at java.security.cert.CertPathBuilder.build(Unknown Source)
Caused: sun.security.validator.ValidatorException: PKIX path building failed
at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
at sun.security.validator.Validator.validate(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
Caused: javax.net.ssl.SSLHandshakeException
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
at sun.security.ssl.Handshaker.processLoop(Unknown Source)
at sun.security.ssl.Handshaker.process_record(Unknown …Run Code Online (Sandbox Code Playgroud) java ×5
http-put ×1
https ×1
jakarta-mail ×1
jenkins ×1
jlink ×1
networking ×1
pkix ×1
security ×1
smtp ×1
ssh ×1
web-services ×1