Problems connecting via HTTPS/SSL through own Java client

前端 未结 4 714
既然无缘
既然无缘 2020-11-27 18:13

I\'m trying to establish a connection to trackobot.com to receive some JSON data. The server only allows connections through HTTPS/SSL. Here is the code:

jav         


        
4条回答
  •  爱一瞬间的悲伤
    2020-11-27 18:48

    Thanks to Steffen Ullrich's tipp I checked the ciphers java had available. Apparently, in Java 8 you don't have unlimited strength for your ciphers. For example, in my case my program couldn't use a AES 256bit cipher which the server required.

    To solve this, oracle provides a bundle of policy files that allow for unlimited strength encryption. You can find it here.

    The README states:

    Due to import control restrictions of some countries, the version of the JCE policy files that are bundled in the Java Runtime Environment, or JRE(TM), 8 environment allow "strong" but limited cryptography to be used.

    Just download the bundle and replace appropriate files as stated in the install instructions. After I did that, the handshake worked like a charm.

提交回复
热议问题