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.

Sahi: allowing certificates

chejnesschejness Members
edited November -1 in Sahi - Open Source
Hi Team,

I am using Sahi for automation.
I am accessing the sites in secured areas which requires the acception of the certificates.
How can i automate the acception of certificates through Sahi.
Is there any workaround for this?

Regards,
Chejness
Tagged:

Comments

  • Use This Command:

    keytool -genkey -alias sahi.example.com -keypass sahipassword
    -storepass sahipassword -keyalg RSA -keystore
    "D:\sahitest\sahi\certs\sahi_example_com" -dname
    "CN=sahi.example.com, OU=Sahi, O=Sahi, L=Bangalore, S=Karnataka, C=IN"

    For more detail Refer this: sahi.co.in/w/httpsssl-sites-do-not-work-properly

    Also you can add certificate in browser. Search around the forums you will get similar post and resolution for it.
    Try with disabling the option like check for certificates and signatures of your IE advance setting tab.
  • narayannarayan Administrators
    Chejness,

    If you are using Internet Explorer, you will need to install the certificate on your browser.
    If you are using Firefox, you will need to accept the certificate permanently.

    You can look at http://www.youtube.com/watch?v=zPZH5L-jkRA to see how to remove IE SSL warnings.
  • hi Narayan,
    we are looking for an automated solution to avoid manual installation of certificates in IE.
    We have a lot of different sites with a lot^2 expiration dates.
    I'm thinking about a nightly job that erases all generated certificates, with sahi offline, and an automatic re-generation of certificates the first time site is accessed. Of course the problem is avoid IE manuality.
    We are looking in Microsoft tech and friends sites ...
    Any suggestion ??

    Tia
    Massimo
  • narayannarayan Administrators
    One thing you can do is,

    1) Create one certificate which acts as the the signer certificate and install this on IE.
    2) Create all other certificates and sign it with the signer certificate. IE will not prompt for installation of certificates since it is signed by a trusted root.

    You cannot sign one certifcate with another using Keytool. You will need openssl for that.

    Regards,
    Narayan
  • hi all
    we solved ( windows only .... eh eh ) ;-)
    First above all I forgot to inform you we are working on a WIN 2003 Server and OpenSSL is not intalled on this machine.
    Solution , we generate the key in the keystore first , after we export the key inside a .cer file, third we use the certutil.exe tool to import the key directly inside IE.

    Here our files :

    ************** ssl.txt *****************************
    c:\sahi\bin\crea_certificato.bat $keytool $domain $password $keystore
    ****************************************************

    ************ c:\sahi\bin\crea_certificato.bat ( batch file called from ssl.txt ) **********
    set keytool=%1
    set domain=%2
    set password=%3
    set keystore=%4
    cd \sahi\certs\

    %keytool% -genkey -alias %domain% -keypass %password% -storepass %password% -keyalg RSA -keystore %keystore% -validity 2000 -dname "CN=%domain%, OU=Sahi, O=Sahi, L=Bangalore, S=Karnataka, C=IN"

    %keytool% -export -alias %domain% -keypass %password% -storepass %password% -keystore %keystore% -file %keystore%.cer

    certutil -addstore ROOT %keystore%.cer
    *********************************************************************

    So we can now schedule every midnight a certificates clean-up inside the c:\sahi\certs directory in order to automatically accept new site certificates ( new site checked or new certificate due expiration )

    cheers
    Massimo
  • narayannarayan Administrators
    Wow! This is great stuff! Thanks a lot, Massimo.

    Regards,
    Narayan
  • Automating a automation tool. Gr8 work massimo.
  • Hi Team,

    Can any one please explain step by step procedure of the following:
    1. How to generate a certificate
    2. Insatll the certificate on IE6
    3. How can I automate the acceptance of certificates through Sahi tool?

    As I need this info asap to be implemented:(
  • PrathiPrathi Members
    Hi Narayan,

    Can you kindly explain step by step on how to install certificate in IE8, as no install certificate button not present.

    Steps followed is
    1. Clicked on IE 8 in the Sahi dashboard
    2. clicked on SSL Manager,
    3. clicked on Certificate error,
    4. clicked on view certificate, here no install certificate button is displayed.

    in this case, how can certificate be installed.
    Thanks
    Mamatha
  • Hi massimo.borgogno and everyone,

    i am using sahi from pass two days when i encounterd with certificates issue i read your solution. how can i reach you ? i have few doubts, the solution contains 2 files or 3 files?
    and where we have to keep the text file "ssl.txt " ? do you need any jars or only sahi setup is enough?
    pls help me out!!
    thanks
    ujwal
  • globalwormingglobalworming Moderators
    edited December 2013
    The latest version (I dindn't checked the others) has a SSLHelper: http://sourceforge.net/p/sahi/code/2281/tree/trunk/sahi/src/net/sf/sahi/ssl/SSLHelper.java
    this will call ssl.txt when you set some things true in your config
    # For automatic SSL keystore creation.
    ssl.auto_create_keystore=true
    # Set the algorithm. Example: For Sun's JDK use SunX509, for IBM use IbmX509
    ssl.algorithm=SunX509
    ssl.password=sahipassword
    # Full file path to keytool utility if not in the system path
    # This is generally in the <java_home>/bin directory
    # On windows, keytool path, if specified, should have double backslashes without encompassing quotes. Eg. 
    # keytool.path=D:\\java path\\bin\\keytool.exe
    keytool.path=keytool
    
  • @globalworming, can you show us how you setup automatic certificate installation on Linux pls? Thanks!
  • I am having issue with Linux as well, can some one help me out here?
  • Well it took some time...

    This issue on github https://github.com/headissue/Sahi/issues/5 has been resolved. Patch it yourself or take the Zip https://github.com/headissue/Sahi/releases for Linux.

    Note, that the project has changed a bit..

    Create issues when you run into problems.

    Regards
    Wormi
Sign In or Register to comment.