rest - Setting SSLContext for AsyncHttpClient - Can not read keystore file -


i need use asynchttpclient in play application make post() call on https protocol. using play 2.2.x version. tried @esfand's code mentioned in below question's first answer failing java.io.filenotfoundexception.

how use play ws ssl?

here did : 1) used keytool command generate keystore on c drive .. this

keytool -import -trustcacerts -alias mypublickey -file "" -keystore "c:\mypublicstore.jks”

it stores file on c drive name mypublicstore.jks" (note double quotes @ end)

2) using following code read that

    keymanagerfactory keymanagerfactory = keymanagerfactory.getinstance(keymanagerfactory.getdefaultalgorithm());     keystore keystore = keystore.getinstance("jks");     inputstream inputstream = new fileinputstream("c:\\mypublicstore.jks\"");     string certpass = play.application().configuration().getstring("certificate.password");     keystore.load(inputstream, certpass.tochararray());     keymanagerfactory.init(keystore, certpass.tochararray());       failing @ line 3 of code. can not find file on system. tried reading file on same location , works fine why can not read jks" type of file? doing wrong here? 

in fileinputstream should give keystore path or certificate path? in advance.

i found out ahc can not used play 2.2.x version. need upgrade 2.3.x version.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -