Could not generate DH keypair(httpclient)

Source from here
Add this library to classpath(following is maven project)

<dependency>

<groupId>org.bouncycastle</groupId> <artifactId>bcprov-jdk16</artifactId> <version>1.46</version> </dependency>

Add following line before access https resource:

Security.addProvider(new BouncyCastleProvider());

...

HttpClient client = ...

HttpGet get = new HttpGet("https://domain")

client.execute(get,repsonse);

...

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章