SSL handshake - java.security.InvalidAlgorithmParameterException issue
up vote
5
down vote
favorite
Need your advice for a java problem.
Currently we have an issue while accessing the web service using java code.
Our vendor is using SSL - RSA 2048 bits (SHA256withRSA) with DH (Diffie–Hellman algorithm) prime value greater than 1024 for SSL.
We have java version 1.6.0.10 in production.
When we are executing the code, we are getting error –
Caused by: java.lang.RuntimeException: Could not generate DH keypair at com.sun.net.ssl.internal.ssl.DHCrypt.<init>(DHCrypt.java:106)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverKeyExchange(ClientHandshaker.java:556)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:183)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:893)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1138)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1165)
... 6 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(DashoA13*..)
at java.security.KeyPairGenerator$Delegate.initialize(KeyPairGenerator.java:627)
at com.sun.net.ssl.internal.ssl.DHCrypt.<init>(DHCrypt.java:100) ... 13 more
This is known bug/limitation of java and its already fixed in v7 and onwards but it still exists in ‘1.6.0.10’
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=7044060
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6521495
In above links, I found below statement –
CUSTOMER SUBMITTED WORKAROUND : Using BouncyCastle's JCE
implementation, which doesn't impose this restriction, or resorting to
the BigNumber API directly.
We cannot upgrade to latest java version. Is there anything we can implement to resolve this SSL handshake issue?
Do we need server side changes for bouncycastle implementation? Or we can use in client side only?
Any advice on solving this issue is highly appreciated.
java ssl java-6
New contributor
Nachiket Bapat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
5
down vote
favorite
Need your advice for a java problem.
Currently we have an issue while accessing the web service using java code.
Our vendor is using SSL - RSA 2048 bits (SHA256withRSA) with DH (Diffie–Hellman algorithm) prime value greater than 1024 for SSL.
We have java version 1.6.0.10 in production.
When we are executing the code, we are getting error –
Caused by: java.lang.RuntimeException: Could not generate DH keypair at com.sun.net.ssl.internal.ssl.DHCrypt.<init>(DHCrypt.java:106)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverKeyExchange(ClientHandshaker.java:556)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:183)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:893)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1138)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1165)
... 6 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(DashoA13*..)
at java.security.KeyPairGenerator$Delegate.initialize(KeyPairGenerator.java:627)
at com.sun.net.ssl.internal.ssl.DHCrypt.<init>(DHCrypt.java:100) ... 13 more
This is known bug/limitation of java and its already fixed in v7 and onwards but it still exists in ‘1.6.0.10’
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=7044060
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6521495
In above links, I found below statement –
CUSTOMER SUBMITTED WORKAROUND : Using BouncyCastle's JCE
implementation, which doesn't impose this restriction, or resorting to
the BigNumber API directly.
We cannot upgrade to latest java version. Is there anything we can implement to resolve this SSL handshake issue?
Do we need server side changes for bouncycastle implementation? Or we can use in client side only?
Any advice on solving this issue is highly appreciated.
java ssl java-6
New contributor
Nachiket Bapat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Update your Java 6 to version 6u171 or later (no need to upgrade).
– rustyx
10 hours ago
add a comment |
up vote
5
down vote
favorite
up vote
5
down vote
favorite
Need your advice for a java problem.
Currently we have an issue while accessing the web service using java code.
Our vendor is using SSL - RSA 2048 bits (SHA256withRSA) with DH (Diffie–Hellman algorithm) prime value greater than 1024 for SSL.
We have java version 1.6.0.10 in production.
When we are executing the code, we are getting error –
Caused by: java.lang.RuntimeException: Could not generate DH keypair at com.sun.net.ssl.internal.ssl.DHCrypt.<init>(DHCrypt.java:106)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverKeyExchange(ClientHandshaker.java:556)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:183)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:893)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1138)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1165)
... 6 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(DashoA13*..)
at java.security.KeyPairGenerator$Delegate.initialize(KeyPairGenerator.java:627)
at com.sun.net.ssl.internal.ssl.DHCrypt.<init>(DHCrypt.java:100) ... 13 more
This is known bug/limitation of java and its already fixed in v7 and onwards but it still exists in ‘1.6.0.10’
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=7044060
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6521495
In above links, I found below statement –
CUSTOMER SUBMITTED WORKAROUND : Using BouncyCastle's JCE
implementation, which doesn't impose this restriction, or resorting to
the BigNumber API directly.
We cannot upgrade to latest java version. Is there anything we can implement to resolve this SSL handshake issue?
Do we need server side changes for bouncycastle implementation? Or we can use in client side only?
Any advice on solving this issue is highly appreciated.
java ssl java-6
New contributor
Nachiket Bapat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Need your advice for a java problem.
Currently we have an issue while accessing the web service using java code.
Our vendor is using SSL - RSA 2048 bits (SHA256withRSA) with DH (Diffie–Hellman algorithm) prime value greater than 1024 for SSL.
We have java version 1.6.0.10 in production.
When we are executing the code, we are getting error –
Caused by: java.lang.RuntimeException: Could not generate DH keypair at com.sun.net.ssl.internal.ssl.DHCrypt.<init>(DHCrypt.java:106)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverKeyExchange(ClientHandshaker.java:556)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:183)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:593)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:893)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1138)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1165)
... 6 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(DashoA13*..)
at java.security.KeyPairGenerator$Delegate.initialize(KeyPairGenerator.java:627)
at com.sun.net.ssl.internal.ssl.DHCrypt.<init>(DHCrypt.java:100) ... 13 more
This is known bug/limitation of java and its already fixed in v7 and onwards but it still exists in ‘1.6.0.10’
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=7044060
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6521495
In above links, I found below statement –
CUSTOMER SUBMITTED WORKAROUND : Using BouncyCastle's JCE
implementation, which doesn't impose this restriction, or resorting to
the BigNumber API directly.
We cannot upgrade to latest java version. Is there anything we can implement to resolve this SSL handshake issue?
Do we need server side changes for bouncycastle implementation? Or we can use in client side only?
Any advice on solving this issue is highly appreciated.
java ssl java-6
java ssl java-6
New contributor
Nachiket Bapat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Nachiket Bapat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 11 hours ago
lospejos
1,31521326
1,31521326
New contributor
Nachiket Bapat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 11 hours ago
Nachiket Bapat
261
261
New contributor
Nachiket Bapat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Nachiket Bapat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Nachiket Bapat is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Update your Java 6 to version 6u171 or later (no need to upgrade).
– rustyx
10 hours ago
add a comment |
Update your Java 6 to version 6u171 or later (no need to upgrade).
– rustyx
10 hours ago
Update your Java 6 to version 6u171 or later (no need to upgrade).
– rustyx
10 hours ago
Update your Java 6 to version 6u171 or later (no need to upgrade).
– rustyx
10 hours ago
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
The jar for BouncyCastle's JCE implementation can be downloaded in LATEST JAVA RELEASES of Bouncy Castle Crypto package.
And the configuration required can be found in To configure a JCE Provider.
After the configuration is done. Print the security providers information like the following code.
Provider providers = Security.getProviders();
for (int i = 0; i != providers.length; i++)
{
System.out.println(providers[i].getInfo());
}
See if "BouncyCastle Security Provider v1.60" is shown.(Suppose you are downloading version 1.6)
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
The jar for BouncyCastle's JCE implementation can be downloaded in LATEST JAVA RELEASES of Bouncy Castle Crypto package.
And the configuration required can be found in To configure a JCE Provider.
After the configuration is done. Print the security providers information like the following code.
Provider providers = Security.getProviders();
for (int i = 0; i != providers.length; i++)
{
System.out.println(providers[i].getInfo());
}
See if "BouncyCastle Security Provider v1.60" is shown.(Suppose you are downloading version 1.6)
add a comment |
up vote
0
down vote
The jar for BouncyCastle's JCE implementation can be downloaded in LATEST JAVA RELEASES of Bouncy Castle Crypto package.
And the configuration required can be found in To configure a JCE Provider.
After the configuration is done. Print the security providers information like the following code.
Provider providers = Security.getProviders();
for (int i = 0; i != providers.length; i++)
{
System.out.println(providers[i].getInfo());
}
See if "BouncyCastle Security Provider v1.60" is shown.(Suppose you are downloading version 1.6)
add a comment |
up vote
0
down vote
up vote
0
down vote
The jar for BouncyCastle's JCE implementation can be downloaded in LATEST JAVA RELEASES of Bouncy Castle Crypto package.
And the configuration required can be found in To configure a JCE Provider.
After the configuration is done. Print the security providers information like the following code.
Provider providers = Security.getProviders();
for (int i = 0; i != providers.length; i++)
{
System.out.println(providers[i].getInfo());
}
See if "BouncyCastle Security Provider v1.60" is shown.(Suppose you are downloading version 1.6)
The jar for BouncyCastle's JCE implementation can be downloaded in LATEST JAVA RELEASES of Bouncy Castle Crypto package.
And the configuration required can be found in To configure a JCE Provider.
After the configuration is done. Print the security providers information like the following code.
Provider providers = Security.getProviders();
for (int i = 0; i != providers.length; i++)
{
System.out.println(providers[i].getInfo());
}
See if "BouncyCastle Security Provider v1.60" is shown.(Suppose you are downloading version 1.6)
answered 9 hours ago
samabcde
9701412
9701412
add a comment |
add a comment |
Nachiket Bapat is a new contributor. Be nice, and check out our Code of Conduct.
Nachiket Bapat is a new contributor. Be nice, and check out our Code of Conduct.
Nachiket Bapat is a new contributor. Be nice, and check out our Code of Conduct.
Nachiket Bapat is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53411739%2fssl-handshake-java-security-invalidalgorithmparameterexception-issue%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Update your Java 6 to version 6u171 or later (no need to upgrade).
– rustyx
10 hours ago