java - SSL Exception <kik.botframework.com> -
i using bot connector rest api , having trouble kik channel. when try respond message, receiving error:
javax.net.ssl.sslexception: hostname in certificate didn't match: <kik.botframework.com> != <*.azurewebsites.net> or <*.azurewebsites.net> or <*.scm.azurewebsites.net> or <*.azure-mobile.net> or <*.scm.azure-mobile.net>
the service url using "https://kik.botframework.com".
i running off of local server @ moment. did not have trouble connecting skype channel in configuration, kik giving me trouble.
i don't have solution, can explain reason behind , may have double check on side.
so, in short, happening because of sni (server name indication) , because of client's inability support sni.
check answer insight issue https://serverfault.com/questions/594368/openssl-returns-different-ssl-certificate-to-that-shown-by-chrome
in case, same ip hosting bunch of domains , certificates. of modern browsers support sni , able detect , show right certificate (try firefox).
however, when ssl client of server trying handshake (without specifying 'server name'/'host name') doesn't know certificate fetch, , hence fetches core certificate.
solution? client should 'indicate' host name , it'll fetch right certificate.
example: openssl s_client -connect dev.botframework.com:443
vs
openssl s_client -servername dev.botframework.com -connect dev.botframework.com:443
how solve this?
skip host name verification phase. disabling ssl certificate validation in spring resttemplate or example:
registry<connectionsocketfactory> registry = registrybuilder. <connectionsocketfactory>create() .register("http", plainconnectionsocketfactory.getsocketfactory()).register("https", new sslconnectionsocketfactory(sslcontexts.createdefault(), new hostnameverifier() { @override public boolean verify(string hostname, sslsession session) { return true; } })).build();
Comments
Post a Comment