- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我尝试向 Web 服务发送 https 请求,在几次成功尝试后,我开始不断收到此错误。这个错误是什么意思,为什么它会在第一次发生。
javax.net.ssl.SSLException: java.lang.RuntimeException: Could not generate DH keypair
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1884)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1842)
at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1825)
at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1751)
at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:127)
at org.apache.http.impl.io.AbstractSessionOutputBuffer.flushBuffer(AbstractSessionOutputBuffer.java:131)
at org.apache.http.impl.io.AbstractSessionOutputBuffer.flush(AbstractSessionOutputBuffer.java:138)
at org.apache.http.impl.io.ContentLengthOutputStream.flush(ContentLengthOutputStream.java:102)
at org.apache.http.entity.StringEntity.writeTo(StringEntity.java:94)
at org.apache.http.entity.HttpEntityWrapper.writeTo(HttpEntityWrapper.java:96)
at org.apache.http.impl.client.EntityEnclosingRequestWrapper$EntityWrapper.writeTo(EntityEnclosingRequestWrapper.java:108)
at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:120)
at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:263)
at org.apache.http.impl.conn.AbstractClientConnAdapter.sendRequestEntity(AbstractClientConnAdapter.java:227)
at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:255)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:622)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:941)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:919)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:910)
at com.nim.service.push.exacttarget.ExactTargetPushService.sendMessageContacts(ExactTargetPushService.java:208)
at com.nim.service.push.exacttarget.ExactTargetPushService.sendPushNotification(ExactTargetPushService.java:106)
at com.nim.domain.push.PushManager.pushHelper(PushManager.java:91)
at com.nim.domain.push.PushManager.pushEntitlementChange(PushManager.java:40)
at com.nim.domain.push.PushManager.pushEntitlementChange(PushManager.java:36)
at com.nim.domain.push.PushManager.pushEntitlementChange(PushManager.java:51)
at com.nim.batch.entitlement.SubscriptionEntitlementWriter.pushClientNotifications(SubscriptionEntitlementWriter.java:161)
at com.nim.batch.entitlement.SubscriptionEntitlementReader.retrievePage(SubscriptionEntitlementReader.java:71)
at com.nim.batch.entitlement.SubscriptionEntitlementReader.retrievePage(SubscriptionEntitlementReader.java:1)
at com.nim.batch.entitlement.EntitlementPagedDifferentialReader.read(EntitlementPagedDifferentialReader.java:96)
at sun.reflect.GeneratedMethodAccessor96.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy77.read(Unknown Source)
at org.springframework.batch.core.step.item.SimpleChunkProvider.doRead(SimpleChunkProvider.java:90)
at org.springframework.batch.core.step.item.FaultTolerantChunkProvider.read(FaultTolerantChunkProvider.java:87)
at org.springframework.batch.core.step.item.SimpleChunkProvider$1.doInIteration(SimpleChunkProvider.java:108)
at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:367)
at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:214)
at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:143)
at org.springframework.batch.core.step.item.SimpleChunkProvider.provide(SimpleChunkProvider.java:103)
at org.springframework.batch.core.step.item.ChunkOrientedTasklet.execute(ChunkOrientedTasklet.java:68)
at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:386)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:264)
at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:76)
at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:367)
at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:214)
at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:143)
at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:250)
at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:195)
at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:135)
at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:61)
at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:60)
at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:144)
at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:124)
at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:135)
at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:281)
at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:120)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: Could not generate DH keypair
at sun.security.ssl.ECDHCrypt.<init>(ECDHCrypt.java:80)
at sun.security.ssl.ClientHandshaker.serverKeyExchange(ClientHandshaker.java:692)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:274)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:878)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:814)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1016)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:702)
at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:122)
... 64 more
Caused by: java.security.InvalidAlgorithmParameterException: parameter object not a ECParameterSpec
at org.bouncycastle.jce.provider.JDKKeyPairGenerator$EC.initialize(Unknown Source)
at sun.security.ssl.ECDHCrypt.<init>(ECDHCrypt.java:75)
... 72 more
最佳答案
我遇到了同样的问题。这篇文章帮助了我:http://iwang.github.io/support/2014/03/14/cxf-cause-https-error.html
本质上,问题在于您使用的是 Bouncy CaSTLe JDK1.4 库,而不是更新的 1.5 库。
为了解决这个问题,我完全删除了 Bouncy CaSTLe。我发现它被一个不相关的库拉入,所以我在 pom.xml 文件的依赖项中添加了以下内容:
<exclusions>
<exclusion>
<groupId>bouncycastle</groupId>
<artifactId>bcmail-jdk14</artifactId>
</exclusion>
<exclusion>
<groupId>bouncycastle</groupId>
<artifactId>bcprov-jdk14</artifactId>
</exclusion>
<exclusion>
<groupId>bouncycastle</groupId>
<artifactId>bctsp-jdk14</artifactId>
</exclusion>
<exclusions>
如果你不能删除它,我建议更新到 jdk15 库。
链接文章的解释:
Java 1.5 introduced a change to the elliptical curve cryptography API. If you use a Java Cryptography Extension (JCE) >provider intended for Java 1.4 or earlier it will not support this new API change and there may be errors with Diffie-Hellman based ciphers when using SSL. The SSL implementation attempts to setup elliptical curve cryptography with a ECGenParameterSpec object. This object wasn't added to until Java 1.5: http://docs.oracle.com/javase/7/docs/api/java/security/spec/ECGenParameterSpec.html (Notice the Since line).
For example, the bcprov-jdk14-131-1.0.jar is Bouncy Castle which is one such provider. This version of the provider is intended for JDK 1.4. Bouncy Castle provides different libraries for each JDK level.
关于java - HttpClient SSLException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26769855/
在 Android Studio 中,当我尝试通过 SDK 管理器更新大型 SDK 时,我不断收到以下错误: SSLException: Connection has been shutdown:
我只是集成 Frimi 支付网关。第一步我尝试生成访问 token ,生成 token 后将调用支付链接。但我收到错误:- SSLException:连接已被对等方关闭。 public void
我发布了 this issue我可以解决它从 WebLogic startups 参数中删除下一个: -Djsse.enableSNIExtension=false 谁能解释一下? 最佳答案 参数 -
我的类(class)有一个简短的任务,即扩展一个简单的 Java 服务器以在 Ubuntu 上支持 SSL。 好的,首先,我这样做了: 私有(private)静态 SSLServerSocketFac
我打算为 Android 应用程序使用 GCM 功能。我设置了正确的 Android 应用程序和部署在本地主机上的后端服务。 一切都很好,通知显示在我的测试设备上。接下来我尝试将服务部署到具有真实 I
所以我想通过 https 测试一下。问题是我得到这个: Error getting response; javax.net.ssl.SSLException Received Fatal alert:
我将我的文件从 android 上传到 aws 服务。我是这样配置的: AwsMetadata awsMetadata = resultData.getParcelable(Params.Comm
我尝试向 Web 服务发送 https 请求,在几次成功尝试后,我开始不断收到此错误。这个错误是什么意思,为什么它会在第一次发生。 javax.net.ssl.SSLException: java.l
我是 React Native 的新手,一直在尝试一两个示例。当我尝试在我的 Mac 上构建 Android“电影”示例时,出现以下错误: ./gradlew :Examples:Movies:and
这个问题已经有答案了: javax.net.ssl.SSLException: Received fatal alert: protocol_version (15 个回答) 已关闭 7 年前。 我试
我正在尝试在 Android 客户端上使用自定义证书实现 SSL 连接。如果我尝试使用我编写的普通 Java 程序连接到同一台服务器(我在其中使用系统参数导入 keystore ),一切正常。此外,如
当我向 Google 云消息传递中心发送新的推送通知时,有时会出现问题。我正在使用可用的 Google 库 here .我正在使用 Tomcat 7.0.35 和 bouncycaSTLe 1.46。
我需要在服务器启动时使用 jax-rs 访问 https URL 以获取一些唯一的 session key 。但是,一旦 session 过期,我将再次触发对该 URL 的点击并取回我的 sessio
我正在使用 Android-Query 进行 HTTP 调用,并且不断收到随机的 SSLExceptions,如下所示: AQuery(7746): javax.net.ssl.SSLExceptio
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: SSL handshake alert: unrecognized_name error since upg
从昨天开始,我无法从 JBoss EAP 6.2 连接到我本地开发机器上的 MicroSoft SQLServer (v11.1.3000.0)。 SQLServer 现在想要使用 SSL 进行连接。
我正在创建一个 web 项目..我已经为此配置了 jdbc 领域..我需要将 java servlet 连接到 mysql 数据库.. private static String JDBC_DRIVE
当使用 Android 的 HttpUrlConnection 库发出 HTTPS 请求时,我有时会看到抛出以下异常: javax.net.ssl.SSLException: SSL handshak
我一直在使用以下代码连接到谷歌的一项服务。这段代码在我的本地机器上运行良好: HttpClient client=new DefaultHttpClient(); HttpPost post = ne
我有一个 Spring Boot 后端项目。我想使用我的 ssl 证书。 这是我的 application.properties 文件。 我使用 mycert.cert 和 mycert.key 创建
我是一名优秀的程序员,十分优秀!