作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们正在尝试让 TLS1.2 在以下环境中以 FIPS 模式工作。尝试写入使用协议(protocol)“TLSv1.2”的 SSLContext 创建的 SSLSocket 失败并显示错误 java.security.NoSuchAlgorithmException: no such algorithm: SunTls12RsaPremasterSecret for provider SunPKCS11-NSS。
环境:
我认为答案是否定的,TLS1.2 在 FIPS 模式下不能与 NSS 3.16+ 一起使用。我需要果断判断:
以下是目前收集到的证据:
相关的 javax.net.debug 输出如下:
*** ClientHello, TLSv1.2RandomCookie: GMT: 1409235389 bytes = { 122, 104, 164, 187, 130, 152, 6, 95, 250, 230, 146, 99, 164, 228, 116, 203, 188, 51, 48, 140, 196, 35, 87, 33, 228, 67, 15, 120 }Session ID: {}Cipher Suites: [TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]Compression Methods: { 0 }Extension signature_algorithms, signature_algorithms: SHA512withECDSA, SHA512withRSA, SHA384withECDSA, SHA384withRSA, SHA256withECDSA, SHA256withRSA, SHA224withECDSA, SHA224withRSA, SHA1withECDSA, SHA1withRSA, SHA1withDSA, MD5withRSA***TRIMMED%% Negotiating: [Session-1, TLS_RSA_WITH_AES_128_CBC_SHA256]*** ServerHello, TLSv1.2RandomCookie: GMT: 1409235389 bytes = { 217, 13, 11, 142, 204, 139, 77, 178, 239, 246, 177, 116, 225, 208, 217, 77, 128, 106, 206, 72, 40, 229, 46, 232, 54, 172, 74, 41 }Session ID: {84, 255, 58, 189, 125, 207, 159, 166, 144, 6, 19, 157, 173, 113, 80, 88, 204, 69, 101, 231, 227, 242, 144, 59, 174, 147, 158, 65, 14, 78, 182, 52}Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA256Compression Method: 0Extension renegotiation_info, renegotiated_connection: ***Cipher suite: TLS_RSA_WITH_AES_128_CBC_SHA256TRIMMED*** ServerHelloDone[read] MD5 and SHA1 hashes: len = 40000: 0E 00 00 00 ....Thread-0, handling exception: javax.net.ssl.SSLKeyException: RSA premaster secret error%% Invalidated: [Session-1, TLS_RSA_WITH_AES_128_CBC_SHA256]12:41:01.684 [Thread-0] ERROR c.p.p.c.i.SslContextTestContainer - unexpected Exceptionjavax.net.ssl.SSLKeyException: RSA premaster secret error at sun.security.ssl.RSAClientKeyExchange.(RSAClientKeyExchange.java:86) ~[na:1.8.0_25] at sun.security.ssl.ClientHandshaker.serverHelloDone(ClientHandshaker.java:880) ~[na:1.8.0_25] at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:344) ~[na:1.8.0_25] at sun.security.ssl.Handshaker.processLoop(Handshaker.java:936) ~[na:1.8.0_25] at sun.security.ssl.Handshaker.process_record(Handshaker.java:871) ~[na:1.8.0_25] at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1043) ~[na:1.8.0_25] at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1343) ~[na:1.8.0_25] at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:728) ~[na:1.8.0_25] at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:123) ~[na:1.8.0_25] at java.io.OutputStream.write(OutputStream.java:75) ~[na:1.8.0_25] at com.polycom.pillars.certificate.internal.SslContextTestContainer$ClientThread.doit(SslContextTestContainer.java:193) ~[bin/:na] at com.polycom.pillars.certificate.internal.SslContextTestContainer$SslConnectionThread.run(SslContextTestContainer.java:127) ~[bin/:na]Caused by: java.security.NoSuchAlgorithmException: no such algorithm: SunTls12RsaPremasterSecret for provider SunPKCS11-NSS at sun.security.jca.GetInstance.getService(GetInstance.java:101) ~[na:1.8.0_25] at javax.crypto.JceSecurity.getInstance(JceSecurity.java:109) ~[na:1.8.0_25] at javax.crypto.KeyGenerator.getInstance(KeyGenerator.java:287) ~[na:1.8.0_25] at sun.security.ssl.JsseJce.getKeyGenerator(JsseJce.java:274) ~[na:1.8.0_25] at sun.security.ssl.RSAClientKeyExchange.(RSAClientKeyExchange.java:77) ~[na:1.8.0_25]
最佳答案
事实上,提供商不支持 TLS1.2。跟踪此问题的错误是: https://bugs.openjdk.java.net/browse/JDK-8029661
关于java - TLS1.2 是否使用配置有 SunPKCS11-NSS 提供程序的 JSSE 在 FIPS 模式下与 NSS 一起工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28972574/
我有一个在 Tomcat 上运行的 Web 应用程序。我的应用程序使用 Web 服务来签名(通过智能卡)并发送电子邮件。 Web 服务本身会在第一次调用期间和发送电子邮件之前自动添加 sunpkcs#
我是一名优秀的程序员,十分优秀!