postman/jmeter 請求https接口配置問題


postman

1:點擊扳手圖標,再點擊Settings

2:關閉SSL校驗

 3:切到Certificates頁簽;添加客戶端校驗

注:

CRT file為客戶端密鑰庫的公鑰
KEY file為客戶端密鑰庫的私鑰
Passphrase為密鑰庫的密碼


4:生成PKCS12數字證書

打開cmd
1、生成私有秘鑰:(先創建目錄d:/temp/store/)
    輸入keytool -genkey -v -alias root -keyalg RSA -storetype PKCS12 -keystore d:/temp/store/test.jks 
    輸入密鑰庫口令:123456;其它全部填空

2、根據私有密鑰生成公鑰
    輸入keytool -export -alias root -keystore d:/temp/store/test.jks -storetype PKCS12 -storepass 123456 -rfc -file d:/temp/store/test.cer

5:將.jks格式的證書轉換為p12證書

keytool -importkeystore -srckeystore d:/temp/store/test.jks -srcstoretype JKS -deststoretype PKCS12 -destkeystore d:/temp/store/test.p12

6:用openssl對一個p12格式密鑰庫進行公鑰和私鑰的導出(生成pem格式證書,需要有p12證書):
先決條件:
  從openssl官網下載www.openssl.org
  安裝openssl[windows和linux安裝不同]
如果沒有配置環境變量,則需要進入openssl的bin目錄下執行命令,如:C:/OpenSSL/bin

 



 

jmeter 

1.下載被測網址證書導入(測試時用的是谷歌瀏覽器):
生成.cer后綴的文件test.cer

2.把導出的證書轉換成.store格式的文件:
在jmeter安裝的bin路徑下運行;keytool -import -alias “name.store”-file “path” -keystore name.store
其中name為轉換成的文件名;path為.cer文件的存放位置

D:\apache-jmeter-2.13\bin>keytool -import -alias "test.store" -file "E:\test.cer" -keystore test.store

3.在http請求的端口號輸入443,協議輸入https
4.在ssl管理器中添加證書(選項--SSL管理器)

轉換成.store文件的證書默認存放在jmeter安裝的bin路徑下運行

運行時要求輸入密碼,密碼為第2步中輸入的密碼

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM