jsse

SSLEngine unwrap() javax.crypto.BadPaddingException: bad record MAC

陌路散爱 提交于 2019-12-02 13:28:48
问题 This has been driving me crazy for a few days now. I created a client using java nio with ssl encryption using an SSLEngine. Handshake works fine, and I write a GET request to a website and it works fine (I get the header with 200 code). The problem is that when the website sends the packets back, on the second packet I get a BadPaddingException. Here is my read method: public void read(SelectionKey key,ByteBuffer readBuffer) throws IOException, BadPaddingException { SocketChannel

Getting SSLHandshakeException when using Dropbox Java SDK for API v2

六月ゝ 毕业季﹏ 提交于 2019-12-02 08:24:51
In a XPages application I want to make use of the Dropbox Java SDK (2.1.2) for API v2 to get information about my Dropbox account. The following code is used to retrieve the corresponding account object: String atoken = "****"; DbxRequestConfig rc = new DbxRequestConfig("****"); DbxClientV2 client = new DbxClientV2(rc,atoken); DbxUserUsersRequests users = client.users(); FullAccount acc = users.getCurrentAccount(); // Exception raised here The last line raises the following exception: com.dropbox.core.NetworkIOException: No appropriate protocol at com.dropbox.core.DbxRequestUtil.startPostRaw

SSLEngine unwrap() javax.crypto.BadPaddingException: bad record MAC

﹥>﹥吖頭↗ 提交于 2019-12-02 07:28:40
This has been driving me crazy for a few days now. I created a client using java nio with ssl encryption using an SSLEngine. Handshake works fine, and I write a GET request to a website and it works fine (I get the header with 200 code). The problem is that when the website sends the packets back, on the second packet I get a BadPaddingException. Here is my read method: public void read(SelectionKey key,ByteBuffer readBuffer) throws IOException, BadPaddingException { SocketChannel socketChannel = (SocketChannel) key.channel(); ByteBuffer clientSSLData = ByteBuffer.allocate(getPacketBufferSize(

How to specify server-preferred order of SSL cipher suites for Java?

和自甴很熟 提交于 2019-12-01 20:17:48
问题 I'm using Java 1.6 and netty 3.8 for HTTP/HTTPS server. I've done SSL test by ssllab.com(https://www.ssllabs.com/ssltest/analyze.html), and I got a result for cipher suites like below. Cipher Suites (sorted by strength; the server has no preference ) But, a result for google.com is something different. https://www.ssllabs.com/ssltest/analyze.html?d=www.google.com&s=74.125.227.148 Cipher Suites ( SSL 3+ suites in server-preferred order , then SSL 2 suites where used) How can I set server-side

How to specify server-preferred order of SSL cipher suites for Java?

筅森魡賤 提交于 2019-12-01 18:22:54
I'm using Java 1.6 and netty 3.8 for HTTP/HTTPS server. I've done SSL test by ssllab.com( https://www.ssllabs.com/ssltest/analyze.html ), and I got a result for cipher suites like below. Cipher Suites (sorted by strength; the server has no preference ) But, a result for google.com is something different. https://www.ssllabs.com/ssltest/analyze.html?d=www.google.com&s=74.125.227.148 Cipher Suites ( SSL 3+ suites in server-preferred order , then SSL 2 suites where used) How can I set server-side preference order for cipher suites? Does JSSE have any property or API about that? Thanks in advance.

What is SunX509 used for and can it work with parties using IbmX509?

China☆狼群 提交于 2019-12-01 16:16:59
When I manually create a KeyManager , one of the steps is this: KeyManagerFactory.getInstance("SunX509") This does not work on IBM jre where I need to specify "IbmX509". My questions: I read that this is called the "certificate encoding algorithm". What does that mean? When is it used? What happens when the client is using the IBM algorithm and the server is using the Sun algorithm? Thanks, Doron I read that this is called the "certificate encoding algorithm". No it isn't. It is a key manager algorithm that defines both a provider and a content type, in this case "Sun" or "IBM" and X.509.

How do I provide a specific TrustStore while using the default KeyStore in Java (JSSE)

只谈情不闲聊 提交于 2019-11-30 21:16:14
Overview JSSE allows users to provide default trust stores and key stores by specifying javax.net.ssl.* parameters. I would like to provide a non-default TrustManager for my application, while allowing the user to specify the KeyManager as usual, but there doesn't seem to be any way to achieve this. Details http://docs.oracle.com/javase/7/docs/technotes/guides/security/jsse/JSSERefGuide.html#CustomizingStores Suppose on unix machines I want to allow the user to use a pkcs12 key store for authentication, while on OS X I want allow the user to use the system keychain. On OS X the application

Where to find Java 6 JSSE/JCE Source Code?

假如想象 提交于 2019-11-30 17:02:28
Where can I download the JSSE and JCE source code for the latest release of Java? The source build available at https://jdk6.dev.java.net/ does not include the javax.crypto (JCE) packages nor the com.sun.net.ssl.internal (JSSE) packages. Not being able to debug these classes makes solving SSL issues incredibly difficult. there: openjdk javax.net in the security group src/share/classes/javax/net src/share/classes/com/sun/net/ssl src/share/classes/sun/security/ssl src/share/classes/sun/net/www/protocol/https also on this page: src/share/classes/javax/crypto src/share/classes/com/sun/crypto

Where to find Java 6 JSSE/JCE Source Code?

血红的双手。 提交于 2019-11-30 16:35:55
问题 Where can I download the JSSE and JCE source code for the latest release of Java? The source build available at https://jdk6.dev.java.net/ does not include the javax.crypto (JCE) packages nor the com.sun.net.ssl.internal (JSSE) packages. Not being able to debug these classes makes solving SSL issues incredibly difficult. 回答1: there: openjdk javax.net in the security group src/share/classes/javax/net src/share/classes/com/sun/net/ssl src/share/classes/sun/security/ssl src/share/classes/sun/net

Can I avoid putting key store password on command-line with JSSE?

泪湿孤枕 提交于 2019-11-30 09:46:25
We are using Maven 2 and have a maven repository manager secured with SSL client authentication. In order for Maven to access the repository the following system properties must be passed to Java: javax.net.ssl.trustStore=trust.jks javax.net.ssl.trustStorePassword= <trustPass> javax.net.ssl.keyStore=keystore.p12 javax.net.ssl.keyStoreType=pkcs12 javax.net.ssl.keyStorePassword= <keyStorePass> See this mini-guide for more details. In order to set these system properties in Maven, I have to use the MAVEN_OPTS environment variable (or pass them directly on the command-line). Either way, when Maven