差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

下次修改
前次修改
rf:rf:ssl_certificate_problem_on_ie11 [2018/01/17 11:30]
tony 建立
rf:rf:ssl_certificate_problem_on_ie11 [2023/06/25 09:48] (目前版本)
行 1: 行 1:
 +{{tag>​selenium RobotFramework IE}}
 ====== SSL Certificate Error On IE11 ====== ====== SSL Certificate Error On IE11 ======
 +===== Problem =====
 +這陣子我們將web連線預設由原本的http轉到https,然而在透過IE做驗收測試時,出現了Certificate Error而導致測試無法繼續下去:​\\
 +{{:​rf:​rf:​ie_ssl_warn.png|}}\\
 +本篇是分享我實驗過與可能的解決方法。
 +===== How to resolve? =====
 +我們使用[[rf:​rf:​seleniumgrid|selenium grid]]的方式做測試,selenium的node搭載環境如下:​
 +  * OS: Windows2012 R2 x64
 +  * IE: IE 11.0.9600.18618
 +  * selenium-server-standalone:​ 3.8.1
 +  * IEDriverServer:​ 3.4.0.0 (32.bit)
 +接下來分享我實驗的方法:​
 +==== 使用desired_capabilities ====
 +我在Open Browser的keyword之後加入以下參數:​
 +<​code>​
 +desired_capabilities=acceptSslCerts:​true;​trustAllSSLCerficates:​true
 +</​code>​
 +透過grid node的console可以看到參數有傳過去,但無法解決問題。
 +==== 更新IEDriverServer ====
 +我將版本更新到3.8.0.0,但Open Browser會有錯誤訊息;礙於時間關係,就不繼續追蹤下去。
 +==== 調整IE11設定 ====
 +起初我調整Internet Options > Advanced設定,但沒作用:​\\
 +{{:​rf:​rf:​ie_options_advanced_certificates.png|}}\\
 +接著我改使用匯入Certificate的方式,點擊Certificate error > View Certificates > Install Certificate:​\\
 +{{:​rf:​rf:​ie_ssl_error_invalid_cert.png|}}\\
 +按照安裝步驟點下去,唯一要注意的是,憑證放置位置要選Trusted Root Certification Authorities:​\\
 +{{:​rf:​rf:​install_cert_to_trusted_root.png|}}\\
 +完成之後重新啟動IE還是會看到Certificate Error,但錯誤已經變成Address Mismatch,這是由於簽發的名稱與實際連線主機名稱不同:​\\
 +{{:​rf:​rf:​ie_ssl_error_address_mismatch.png?​|}}\\
 +所以要去改IE設定,取消這個檢查:​\\
 +{{:​rf:​rf:​ie_options_advanced_address_mismatch.png|}}\\
 +重新啟動IE後應該就能夠正常執行測試。\\
 +\\
 +\\
 +這個方法只適用於專門測試的機器,一般正常使用的機器這樣做會降低安全性;此外,如果憑證有改或新增就要再執行匯入,比較不方便。
 ===== Reference ===== ===== Reference =====
   * [[https://​github.com/​SeleniumHQ/​selenium/​issues/​4704|Selenium Grid cannot launch IE11 and report IE driver cannot bypass insecure SSL certificate]]   * [[https://​github.com/​SeleniumHQ/​selenium/​issues/​4704|Selenium Grid cannot launch IE11 and report IE driver cannot bypass insecure SSL certificate]]
   * [[https://​github.com/​SeleniumHQ/​selenium/​wiki/​DesiredCapabilities|DesiredCapabilities]]   * [[https://​github.com/​SeleniumHQ/​selenium/​wiki/​DesiredCapabilities|DesiredCapabilities]]
   * [[https://​stackoverflow.com/​questions/​24507078/​how-to-deal-with-certificates-using-selenium|How to deal with certificates using Selenium?]]   * [[https://​stackoverflow.com/​questions/​24507078/​how-to-deal-with-certificates-using-selenium|How to deal with certificates using Selenium?]]
 +  * [[https://​www.technipages.com/​ie-bypass-problem-with-this-websites-security-certificate|IE:​ Bypass “There is a problem with this website’s security certificate” Message]]
 +
 +=====    =====
 +----
 +\\
 +~~DISQUS~~