0
votes

I got some code from a very helpful Stackoverflow contributor (Michal Foska), and I am having some issues implementing it in a Mobilefirst Adapter. It seems that Mobilefirst picks up the wrong SSLConnectionSocketFactory class which does not have the same constructor as below.

It appears to only allow a X509HostnameVerifier. Any ideas?

SSLConnectionSocketFactory sslCF = new SSLConnectionSocketFactory(context, new HostnameVerifier() {
@Override
 public boolean verify(String hostname, SSLSession session) {
 // or add your own test here
    return true;
 }});
1
Only issue left I hope...is this one....all related to other posts..How to create a Hostname Verifier to get past the issue of javax.net.ssl.SSLPeerUnverifiedException: Host name 'falcon-uat.wroclaw-centrum.pl.ibm.com' does not match the certificate subject provided by the peer - Tim
Idan, Any idea on how to get MobileFirst adapter to use the correct Class for SSLConnectionSocketFactory? It does not seem to want to use a signature matching what I have shown above - Tim
Were you able to resolve this? - Idan Adar
I resolved it by having the certificate fixed.....but never found out how to get the Hostname Verifier to work in adapter. - Tim

1 Answers

0
votes

From the comments:

Tim: I resolved it by having the certificate fixed.....but never found out how to get the Hostname Verifier to work in adapter.