18 January 2026:


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.

SSL errors coming on Sahi.bat console

vazidvazid Members
edited November -1 in Sahi - Open Source
Am getting some error on sahi.bat console which i have no idea about...
Could any one let me know why this would be coming and what should i have to do to over come it..


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: Remote host closed connection during handsh
ake
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)
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
... 14 more
javax.net.ssl.SSLHandshakeException: no cipher suites in common
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
at com.sun.net.ssl.internal.ssl.ServerHandshaker.chooseCipherSuite(Unkno
wn Source)
at com.sun.net.ssl.internal.ssl.ServerHandshaker.clientHello(Unknown Sou
rce)
at com.sun.net.ssl.internal.ssl.ServerHandshaker.processMessage(Unknown
Source)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source
)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)

Comments

  • narayannarayan Administrators
    Vazid, is your application using SSL to communicate with any server? If not this may be because another browser instance is trying to access gmail or another website which needs SSL. If you are using IE, the same proxy settings are used by other applications too, so it may even be a chat application. You must be able to see which URL it is trying to connect to just before the error on the console.
  • vazidvazid Members
    edited February 2009
    I just closed all other websites which were opened and tried out with only my application on IE7...still it exists...seems application is interacting with some server which requires ssl..and this error is coming up when i try to bring up the sahi recorder after clicking Alt+DblClick.....

    But the application i'm working on is Http based...How does it makes difference to sahi with some other server application is interacting?
  • I am getting the same error as mentioned above. Please help...
  • narayannarayan Administrators
    Which browser are you using? Is your application https? If not check the url that is displayed on the console and paste it here (without https://). This would mostly because of some phishing filter on your browser. The url will confirm that.
  • i am using IE 7.0. I am using yahoo.com
  • Need help on this..
  • narayannarayan Administrators
    Hi Hamraj,

    You are getting those errors because you are trying to access an HTTPS site. If you are just starting to use Sahi, you could use simple pages like http://sahi.co.in/demo to test out and learn about various controls.

    If you really want to automate yahoo.com, have a look at http://sahi.co.in/w/httpsssl-sites-do-not-work-properly to see how to work with HTTPS sites.

    Let us know if this did not answer your query and you need more help.

    Regards,
    Narayan
  • Thanks for ur reply
  • Getting below when trying to access any website. Don't know why

    HTTPS/SSL START

    Sahi is trying to create a certificate for domain:
    urs.microsoft.com

    If you are unable to connect to this HTTPS site, do the following:
    Check on your filesystem to see if a file like
    C:\SAHI\sahi\certs\urs_microsoft_com
    has been created.

    If not, then create it by running the command below on a command prompt.
    Note that you need 'keytool' to be in your path.
    keytool comes with the JDK by default and is present in <JAVA_HOME>/bin.

    Once you create that file, SSL/HTTPS should work properly for that site.


    COMMAND START

    keytool -genkey -alias urs.microsoft.com -keypass sahipassword -storepass sahipa
    ssword -keyalg RSA -keystore C:\SAHI\sahi\certs\urs_microsoft_com -dname "CN=urs
    .microsoft.com, OU=Sahi, O=Sahi, L=Bangalore, S=Karnataka, C=IN" -validity 3650

    COMMAND END

    The files in certs can be copied over to other systems to make ssl/https work th
    ere.

    HTTPS/SSL END



    java.io.FileNotFoundException: ..\certs\sahi_example_com (The system cannot find
    the file specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at net.sf.sahi.ssl.SSLHelper.getKeyManagerFactory(SSLHelper.java:98)
    at net.sf.sahi.ssl.SSLHelper.createSocketFactory(SSLHelper.java:69)
    at net.sf.sahi.ssl.SSLHelper.getSSLClientSocketFactory(SSLHelper.java:58
    )
    at net.sf.sahi.ssl.SSLHelper.convertToSecureSocket(SSLHelper.java:190)
    at net.sf.sahi.ssl.SSLHelper.convertToSecureServerSocket(SSLHelper.java:
    199)
    at net.sf.sahi.ProxyProcessor.processConnect(ProxyProcessor.java:212)
    at net.sf.sahi.ProxyProcessor.processAsProxy(ProxyProcessor.java:117)
    at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:82)
    at java.lang.Thread.run(Unknown Source)
    ----
    Client certificate not found: ../certs/sahi_example_com
    ----
  • try creating certificates and put them into Sahi\certs folder.
    In order to create certificates you need to run below command from command line after changing the path to bin folder of installed jre. (ex: cd C:\Program Files\Java\jre1.5.0_01\bin)

    keytool -genkey -alias urs.microsoft.com -keypass sahipassword -storepass sahipa
    ssword -keyalg RSA -keystore C:\SAHI\sahi\certs\urs_microsoft_com -dname "CN=urs
    .microsoft.com, OU=Sahi, O=Sahi, L=Bangalore, S=Karnataka, C=IN" -validity 3650
  • Note:
    in command you can see C:\SAHI\sahi\certs\urs_microsoft_com. If sahi is not placed at C:\SAHI location then this will not work.
  • narayannarayan Administrators
    urs.microsoft.com is the URL Reputation Service

    You will get more details here:
    http://www.google.co.in/search?hl=en&q=urs.microsoft.com&btnG=Search&meta=&aq=f&oq=

    On your browser, set the proxy only for http and not for https. You will not get these errors.
  • EEconsultEEconsult Members
    edited October 2009
    When using sahi to access ssl sites where I would like sahi to automatically create certificates, I have come across the following error:

    In Firefox:

    Secure Connection Failed

    An error occurred during a connection to secure.hsabank.com.
    Cannot communicate securely with peer: no common encryption algorithm(s).
    (Error code: ssl_error_no_cypher_overlap)

    * The page you are trying to view can not be shown because the authenticity of the received data could not be verified.
    * Please contact the web site owners to inform them of this problem. Alternatively, use the command found in the help menu to report this broken site.



    At that same time, the sahi console window shows this message:


    HTTPS/SSL START

    Sahi is trying to create a certificate for domain:
    secure.hsabank.com

    If you are unable to connect to this HTTPS site, do the following:
    Check on your filesystem to see if a file like
    /home/eeconsult/sahi/userdata/certs/secure_hsabank_com
    has been created.

    If not, then create it by running the command below on a command prompt.
    Note that you need 'keytool' to be in your path.
    keytool comes with the JDK by default and is present in <JAVA_HOME>/bin.

    Once you create that file, SSL/HTTPS should work properly for that site.


    COMMAND START

    "keytool" -genkey -alias secure.hsabank.com -keypass "sahipassword" -storepass "sahipassword" -keyalg RSA -keystore "/home/eeconsult/sahi/userdata/certs/secure_hsabank_com" -dname "CN=secure.hsabank.com, OU=Sahi, O=Sahi, L=Bangalore, S=Karnataka, C=IN" -validity 3650

    COMMAND END

    The files in certs can be copied over to other systems to make ssl/https work there.

    HTTPS/SSL END



    java.io.FileNotFoundException: /home/eeconsult/sahi/userdata/certs/secure_hsabank_com (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:106)
    at java.io.FileInputStream.<init>(FileInputStream.java:66)
    at net.sf.sahi.ssl.SSLHelper.getKeyManagerFactory(SSLHelper.java:98)
    at net.sf.sahi.ssl.SSLHelper.createSocketFactory(SSLHelper.java:69)
    at net.sf.sahi.ssl.SSLHelper.getSSLClientSocketFactory(SSLHelper.java:58)
    at net.sf.sahi.ssl.SSLHelper.convertToSecureSocket(SSLHelper.java:189)
    at net.sf.sahi.ssl.SSLHelper.convertToSecureServerSocket(SSLHelper.java:198)
    at net.sf.sahi.ProxyProcessor.processConnect(ProxyProcessor.java:146)
    at net.sf.sahi.ProxyProcessor.processAsProxy(ProxyProcessor.java:113)
    at net.sf.sahi.ProxyProcessor.run(ProxyProcessor.java:78)
    at java.lang.Thread.run(Thread.java:619)
    ----
    Client certificate not found: /home/eeconsult/sahi/userdata/certs/secure_hsabank_com
    ----

    That error was obviously generated with sahi v3 Release 2009-10-22, but a similar error had been occurring with Release 2009-9-22 (which is the only other version I have used). I had traced the problem to the creation of the command line used to call keytool. While the command line sahi suggested in the error message itself is correct and works well, the command line sahi sent to keytool was in fact different.

    The difference is that it contains null parameters as it is passed to the os. I am running linux, and verified this using strace. Since I don't have a build environment setup, I created an intermediary script that receives the command line parameters, and removes the null entries. Here is a log generated by the intermediary program (after being called by sahi, via an adjustment to the keytool.path=keytool_intermediary):


    Running keytool_intermediary, called with command line parameters:
    ARG:: [NUL]
    ARG:-genkey:
    ARG:-alias:
    ARG:secure.hsabank.com:
    ARG:-keypass:
    ARG:sahipassword:
    ARG:: [NUL]
    ARG:-storepass:
    ARG:sahipassword:
    ARG:: [NUL]
    ARG:-keyalg:
    ARG:RSA:
    ARG:-keystore:
    ARG:/home/eeconsult/sahi/userdata/certs/secure_hsabank_com:
    ARG:: [NUL]
    ARG:-dname:
    ARG:CN=secure.hsabank.com, OU=Sahi, O=Sahi, L=Bangalore, S=Karnataka, C=IN:
    ARG:: [NUL]
    ARG:-validity:
    ARG:3650:


    Note that the lines marked with NUL are parameters that are being stripped from the command line by the intermediary because they contained a null-string when sent by sahi.

    After the NUL parameters are removed, keytool is called by the intermediary, and the certificates are generated correctly and automatically.

    I hope this helps.

    Thanks for all the great work with sahi. It is a truly powerful tool.
  • narayannarayan Administrators
    EEconsult,

    Thanks a lot for that detailed report. It helped us pin point and fix the problem. We will be making another release with that fix very soon.

    Regards,
    Narayan
  • narayannarayan Administrators
    EEconsult,

    New build of Sahi (2009-10-23) has the necessary fix.

    Thanks,
    Narayan
Sign In or Register to comment.