发送邮件因SSL证书失败,如何添加新证书或检查是否真的是源错误?

时间:2015-09-09 19:48:08

标签: java email ssl jboss ssl-certificate

我是ssl证书的新手,在我们的服务器(1.1以下的规格)中,一个月前“发送邮件”服务停止工作。我按照日志,似乎ssl证书存在问题(Trace低于1.2)

  • 1.1服务器规格:jdk 1.4.2,jboss ga 4.0.2 windows server 2003
  • 1.2追踪:

    Caused by: javax.net.ssl.SSLHandshakeException:     sun.security.validator.ValidatorException: Certificate signature validation failed
        at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(DashoA12275)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
        at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
        at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(DashoA12275)
    at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(DashoA12275)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA12275)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA12275)
    at com.sun.net.ssl.internal.ssl.AppInputStream.read(DashoA12275)
    at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:97)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
    at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:75)
    at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1440)
    ... 36 more
     Caused by: sun.security.validator.ValidatorException: Certificate signature validation failed
    at sun.security.validator.SimpleValidator.engineValidate(SimpleValidator.java:137)
    at sun.security.validator.Validator.validate(Validator.java:202)
    at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(DashoA12275)
    at com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(DashoA12275)
    ... 48 more
        Caused by: java.security.NoSuchAlgorithmException: 1.2.840.113549.1.1.11 Signature not available
    at java.security.Security.getEngineClassName(Security.java:672)
    at java.security.Security.getEngineClassName(Security.java:683)
    at java.security.Security.getImpl(Security.java:1132)
    at java.security.Signature.getInstance(Signature.java:169)
    at sun.security.x509.X509CertImpl.verify(X509CertImpl.java:425)
    at sun.security.x509.X509CertImpl.verify(X509CertImpl.java:383)
    at sun.security.validator.SimpleValidator.engineValidate(SimpleValidator.java:135)
    ... 51 more
    

引起我注意的是“签名不可用”所以我检查了很多但是似乎无法找到这个问题的根源,没有人对服务器证书或java.security文件做过任何更改,当我发送邮件时,似乎也会出现错误的代码。奇怪的是,一切都在我的测试服务器上运行,但不在我的生产服务器上。

1 个答案:

答案 0 :(得分:2)

您尝试运行不支持sha256算法的java1.4,

尝试http://www.bouncycastle.org/latest_releases.html

或转到更新的jdk 1.5 / 6会做