certificate - Openning an SSL web-browser connection in HtmlUnit library -
certificate - Openning an SSL web-browser connection in HtmlUnit library -
i've searched through web couple hours on issue, , none of answers found didn't fit problem, here's me, asking first-ever question in sof.
so, i'm trying open web-browser java programme using htmlunit library. web site need connect requires ssl connection, , certificate stored in usb key. ikey2023 product.
the scheme used work(i did not write it), 1 of certificates in usb key expired, automatically moved on next 1 (there 4 certificates in total), , stopped working.
it giving me javax.net.ssl.sslpeerunverifiedexception: peer not authenticated error.
i'm home , forgot exact name of method, remember following.
browser instance created, using ie8
browser.setwebconnection method called. method, according api, internal api.
make connection website passing url parameter
it's throwing exception @ step 3.
some more details. little details might wrong i'm tyring describe big picture. @ step 2, method requites webconnection object parameter, , there implementation of interface. within implementation, keystore created using sun.security.pkcs11.sunpkcs11(configfileinputstream) (did spell correctly?)
it sth this.
provider p = new sun.security.pkcs11.sunpkcs11(configfileinputstream); security.addprovider(p);
and create keystore provider.
using keystore, within webconnection implementation, creates sslsocket.
so, after certificate has been switched new one, it's not picking certificate correctly.
here's i've tried.
i've tried utilize different methods in htmlunit library, setsecurityprovider, , tried set provider object created in above code snippet. got class cast exception.
i tried manually set scheme properties(truststore, truststorepassword, keystore, etc). in order this, wanted export certificate out of usb key, did not allow me export private key out it, not create valid pkcs12 file out of (openssl wanted private key file along .pem file conversion, , did not have key file).
they did not work, , i'm stuck right now. help/hint appreciated. if need more details, can provide them tomorrow, think i've given plenty details here.
thanks in advance.
i have similar issue. in case, admin changed certificate , began encountering same sslpeerunverifiedexception.
i found can set webclient utilize insecuressl (prior calling getpage())and no longer exception.
webclient.setuseinsecuressl(true);
this however, doesn't resolve issue server doesn't authenticate client.
its if webclient storing doesn't work new certificate.
ssl certificate htmlunit
Comments
Post a Comment