18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
SSLHandshakeException on all navigation within https
I am receiving the exception (javax.net.ssl.SSLHandshakeException) below in the sahi console log on every navigation within a https site. An example is the login page for gmail (as a new user I apparently can't post a link here).
I am using Firefox 3 on Windows Vista. Sahi version: Sahi V2 Release 2009-01-21.
I have followed the instructions at (sahi website) httpsssl-sites-do-not-work-properly
keytool is in the PATH and the certificates are getting generated in the /sahi/certs directory. I have added exceptions in Firefox for the SSL certificates.
After doing all that, I can't bring up the sahi controller (via ctrl-alt-double-click) on the gmaill login page and I get repeated instances of the SSLHandshakeException in the sahi console.
I am able to bring up the sahi controller on non-https sites.
I am currently doing a proof-of-concept for possibly using sahi in a test automation project. If I can't get past this, I will likely drop sahi. I'd appreciate any help. Thanks.
Here is the full exception from the console:
>>>> Sahi started. Listening on port:9999
>>>> Configure your browser to use this server and port as its proxy
>>>> Browse any page and CTRL-ALT-DblClick on the page to bring up the Sahi Cont
roller
javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Un
known Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(Unknown Sou
rce)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
at net.sf.sahi.StreamHandler.setRawHeaders(StreamHandler.java:102)
at net.sf.sahi.StreamHandler.populateHeaders(StreamHandler.java:51)
at net.sf.sahi.request.HttpRequest.<init>(HttpRequest.java:75)
at net.sf.sahi.ProxyProcessor.getRequestFromBrowser(ProxyProcessor.java:
226)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:64)
at net.sf.sahi.ProxyProcessor.processConnect(ProxyProcessor.java:210)
at net.sf.sahi.ProxyProcessor.processAsProxy(ProxyProcessor.java:119)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:84)
at java.lang.Thread.run(Unknown Source)
javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Un
known Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(Unknown Sou
rce)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
at net.sf.sahi.StreamHandler.setRawHeaders(StreamHandler.java:102)
at net.sf.sahi.StreamHandler.populateHeaders(StreamHandler.java:51)
at net.sf.sahi.request.HttpRequest.<init>(HttpRequest.java:75)
at net.sf.sahi.ProxyProcessor.getRequestFromBrowser(ProxyProcessor.java:
226)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:64)
at net.sf.sahi.ProxyProcessor.processConnect(ProxyProcessor.java:210)
at net.sf.sahi.ProxyProcessor.processAsProxy(ProxyProcessor.java:119)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:84)
at java.lang.Thread.run(Unknown Source)
I am using Firefox 3 on Windows Vista. Sahi version: Sahi V2 Release 2009-01-21.
I have followed the instructions at (sahi website) httpsssl-sites-do-not-work-properly
keytool is in the PATH and the certificates are getting generated in the /sahi/certs directory. I have added exceptions in Firefox for the SSL certificates.
After doing all that, I can't bring up the sahi controller (via ctrl-alt-double-click) on the gmaill login page and I get repeated instances of the SSLHandshakeException in the sahi console.
I am able to bring up the sahi controller on non-https sites.
I am currently doing a proof-of-concept for possibly using sahi in a test automation project. If I can't get past this, I will likely drop sahi. I'd appreciate any help. Thanks.
Here is the full exception from the console:
>>>> Sahi started. Listening on port:9999
>>>> Configure your browser to use this server and port as its proxy
>>>> Browse any page and CTRL-ALT-DblClick on the page to bring up the Sahi Cont
roller
javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Un
known Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(Unknown Sou
rce)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
at net.sf.sahi.StreamHandler.setRawHeaders(StreamHandler.java:102)
at net.sf.sahi.StreamHandler.populateHeaders(StreamHandler.java:51)
at net.sf.sahi.request.HttpRequest.<init>(HttpRequest.java:75)
at net.sf.sahi.ProxyProcessor.getRequestFromBrowser(ProxyProcessor.java:
226)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:64)
at net.sf.sahi.ProxyProcessor.processConnect(ProxyProcessor.java:210)
at net.sf.sahi.ProxyProcessor.processAsProxy(ProxyProcessor.java:119)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:84)
at java.lang.Thread.run(Unknown Source)
javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Un
known Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(Unknown Sou
rce)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
at net.sf.sahi.StreamHandler.setRawHeaders(StreamHandler.java:102)
at net.sf.sahi.StreamHandler.populateHeaders(StreamHandler.java:51)
at net.sf.sahi.request.HttpRequest.<init>(HttpRequest.java:75)
at net.sf.sahi.ProxyProcessor.getRequestFromBrowser(ProxyProcessor.java:
226)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:64)
at net.sf.sahi.ProxyProcessor.processConnect(ProxyProcessor.java:210)
at net.sf.sahi.ProxyProcessor.processAsProxy(ProxyProcessor.java:119)
at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:84)
at java.lang.Thread.run(Unknown Source)
Comments
Accept the certificate for sahi.example.com.
You will then see a list of domains that Sahi has created certificates for. Some of them will be red and some green. Click on the red ones, and you will get a certificate dialog which you would need to accept. Once you have accepted the required certificates on the browser, you should be able to navigate properly to the web page.
On IE and Firefox, if the page you are accessing is in a script tag or in an iframe (IE) and it does not have a valid certificate, the browser does not show an error or throw up a certificate error. It just silently rejects it. The SSLManager exposes all these hidden domains too, so that certificates can be accepted.
Hope that helps.
Regards,
Narayan