跳到主要内容

HTTPS

TLS 1.2

The PiedPay API requires all communications to be secured using TLS 1.2.

Here are the relevant setup methods for common programming languages:

PHP

curl_setopt ($url, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);

Java

JVM

// for Java 1.7 or Java 1.6 (update 111 or later), start JVM using:
-Dhttps.protocols=TLSv1.2

// for Java 1.6 prior to update 111, or earlier
// Update Java

Apache-HttpClient

SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(
SSLContexts.createDefault(),
new String[] { "TLSv1.2" },
null,
SSLConnectionSocketFactory.getDefaultHostnameVerifier());
CloseableHttpClient httpClient = HttpClients.custom().setSSLSocketFactory(sslsf).build();

Python

urllib3

// install
python3 -m pip3 install pyOpenSSL

// usage
import urllib3.contrib.pyopenssl
urllib3.contrib.pyopenssl.inject_into_urllib3()

libcurl

// install (e.g. ubuntu)
sudo apt-get update && sudo apt-get install --only-upgrade openssl
sudo apt-get update && sudo apt-get install --only-upgrade libssl-dev

// install (e.g. centos)
sudo yum update openssl libcurl

Go

// for Go 1.13 or above, tls 1.2 is supported by default
// nothing need to do

// for older version of Go
TLSClientConfig: &tls.Config{
MinVersion: tls.VersionTLS12,
}