在Postman中使用自簽的SSL認證

來源:互聯網
上載者:User

標籤:des   blog   http   使用   os   io   strong   for   

add by zhj: 如果是自簽的SSL認證,Postman會出現圖1的錯誤,這時我們需要直接在Chrome的地址欄目輸入該root URL,出現圖2,選擇“繼續”。

這樣,再用Postman就OK了,但是當關閉Chrome後,又出現同樣的問題,所以終極解決辦法是把認證匯出,然後將認證的頒發機構(其實就是用putty生

成認證請求時填寫的Common Name,即伺服器網域名稱或IP)添加到可信任的根憑證授權單位,這樣就OK了。在Win7上用Chrome實驗過,成功。

 

原文:http://blog.getpostman.com/index.php/2014/01/28/using-self-signed-certificates-with-postman/

Self-signed certificates are often used in testing and development environments to provide a layer of security for an API.

As they are not verified by a trusted authority, accessing  an API endpoint with something like https://<ip> through Postman, would throw up an error like this:

With the legacy app, you could go to the root URL in Chrome and allow the browser to access URLs with self-signed certificates. But this doesn’t work with the new packaged app.

If you try to hit a URL with a self-signed SSL certificate, you would get a 500 error as Chrome would decline the certificate:

Turns out that there is a better solution to solve this a problem, and it also avoids adding an exception to Chrome every time you start the browser. This is how you do it:

1. Go to the root URL in your browser. For ex. https://localhost
2. Click on the lock icon on the top left in the URL bar.
3. Open the Connection tab in the dropdown that comes up
4. Click on certificate information

The dialog that comes up now depends on the operating system you are on. Chrome uses the underlying OS layer to handle SSL certificates.

Mac OS X

1. In the dialog that comes up, click and drag the certificate icon to your desktop to create a *.cer file


2. Double click on the file to open the OS X Keychain Access tool.
3. Add the certificate to the System keychain and select “Always trust”


4. Once the certificate is added, double click it to open more details


5. Expand the Trust item
6. Select “Always trust”


7. Close Keychain Access and restart Chrome

Windows

1. In the certificates window, go to the Details tab


2. Select Copy to File
3. Save the certificate file on your disk. Close the certificate window.


4. Go to Chrome > Settings, search for SSL (chrome://settings/search#ssl) and click on Manage certificates


5. Go to the Trusted Root Certification Authorities tab and click on import
6. Select the file you saved on your disk in step 3.


7. Close this window and restart Chrome.

Linux

1. Go to the Details tab


2. Select Export and save the file on your disk


3. Go to Chrome > Settings, search for SSL (chrome://settings/search#ssl) and click on Manage certificates
4. Go into the Authorities tab


5. Import the certificate
6. Restart Chrome

You should be able to fire requests to the endpoints validated by this certificate. The SSL warning will not show up in Chrome even if you restart the browser.

Do make sure that you have verified the IP where the certificate comes from. This should only be done for verified IP addresses.

This method also works for certificates for localhost. Make sure that the common name of the certificate while generating the certificate is localhost.

Let me know in the comments if you face any problems with this.

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.