# 波波錢包-API 驗證方法 [TOC] ### 波波錢包提供兩層 API 驗證機制 1. HTTP Request 來源須在預先約定之 IP Address 白名單中 2. Request 附帶憑證公私鑰驗證內容 兩者皆通過驗證之 Request 才能正常執行 ### IP Address 白名單 - 合作方分別提供 UT / UAT / Production 環境之伺服器固定 IP Address - 各環境將只接受白名單中已設定 IP 送出之 Request ### Mutual Transport Layer Security(HTTPS 雙向身份驗證) - 藉由波波 CA 簽發 Client 端憑證,效期為期一年 - 應於效期截止前一個月,需請求波波 CA 提供新憑證,此憑證內含公私鑰 ( `.crt` & `.key` ) #### curl Example ```shell= curl -v https://mtlstest.powallet.co --cert ~/tmp/mtls/mtls.crt --key ~/tmp/mtls/mtls.key ``` #### PHP Example ```php= $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://mtlstest.powallet.co'); curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2); curl_setopt($ch, CURLOPT_SSLCERT, 'client.crt'); curl_setopt($ch, CURLOPT_SSLKEY, 'client.key'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); ``` #### Python Example ```python= result = requests.get( 'https://mtlstest.powallet.co/test_api', cert=('client.crt', 'client.key') ) ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up