New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not generate DH keypair #69

Closed
fragsalat opened this Issue May 21, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@fragsalat

fragsalat commented May 21, 2015

Hey.

I got the runtime exception with could not generate dh keypair.
Our jenkins is running with an self signed ssl certificate.
With simply initializing JenkinsServer with the Jenkins URL and doing any request such getJobs the plugin throws that exception.
I'm using 0.3.1-SNAPSHOT which was compiled from latest master of this repository.

Any ideas?

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:1904)
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1862)
    at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1845)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1366)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1343)
    at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:535)
    at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:403)
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:177)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304)
    at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446)
    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
    at com.offbytwo.jenkins.client.JenkinsHttpClient.get(JenkinsHttpClient.java:123)
    at com.offbytwo.jenkins.JenkinsServer.getJob(JenkinsServer.java:133)
    at de.test.stash.RefBuildProvider.getMetadata(RefBuildProvider.java:50)
    at com.atlassian.stash.internal.repository.PluginRefMetadataMapProvider$2.call(PluginRefMetadataMapProvider.java:109)
    at com.atlassian.stash.internal.repository.PluginRefMetadataMapProvider$2.call(PluginRefMetadataMapProvider.java:105)
    at com.atlassian.stash.internal.concurrent.StateTransferringExecutorService$StateTransferringCallable.call(StateTransferringExecutorService.java:147)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: Could not generate DH keypair
    at sun.security.ssl.DHCrypt.<init>(DHCrypt.java:136)
    at sun.security.ssl.ClientHandshaker.serverKeyExchange(ClientHandshaker.java:688)
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:261)
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:913)
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:849)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1023)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1359)
    ... 24 more
Caused by: java.security.InvalidAlgorithmParameterException: Prime size must be multiple of 64, and can only range from 512 to 1024 (inclusive)
    at com.sun.crypto.provider.DHKeyPairGenerator.initialize(DHKeyPairGenerator.java:120)
    at java.security.KeyPairGenerator$Delegate.initialize(KeyPairGenerator.java:675)
    at sun.security.ssl.DHCrypt.<init>(DHCrypt.java:127)
    ... 31 more
@fragsalat

This comment has been minimized.

Show comment
Hide comment
@fragsalat

fragsalat May 21, 2015

Solved by using java 7+.
Java 6 doesn't allow certificates which are longer than 1024 bytes.

fragsalat commented May 21, 2015

Solved by using java 7+.
Java 6 doesn't allow certificates which are longer than 1024 bytes.

@khmarbaise

This comment has been minimized.

Show comment
Hide comment
@khmarbaise

khmarbaise Aug 31, 2015

Member

So we can close issue.

Member

khmarbaise commented Aug 31, 2015

So we can close issue.

@khmarbaise khmarbaise closed this Aug 31, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment