30
30
31
31
int main (int argc , char * * argv )
32
32
{
33
- CURL * curl ;
34
- CURLcode res ;
33
+ CURL * curl ;
34
+ CURLcode res ;
35
35
36
- curl = curl_easy_init ();
37
- if (curl ) {
38
- curl_easy_setopt (curl , CURLOPT_URL , "https://127.0.0.1:443" );
39
- curl_easy_setopt (curl , CURLOPT_SSLVERSION , CURL_SSLVERSION_NTLSv1_1 );
40
- curl_easy_setopt (curl , CURLOPT_SSL_CIPHER_LIST ,
41
- "ECDHE-SM2-SM4-CBC-SM3" );
36
+ curl = curl_easy_init ();
37
+ if (curl ) {
38
+ curl_easy_setopt (curl , CURLOPT_URL , "https://127.0.0.1:443" );
39
+ curl_easy_setopt (curl , CURLOPT_SSLVERSION , CURL_SSLVERSION_NTLSv1_1 );
40
+ curl_easy_setopt (curl , CURLOPT_SSL_CIPHER_LIST ,
41
+ "ECDHE-SM2-SM4-CBC-SM3" );
42
42
43
- curl_easy_setopt (curl , CURLOPT_SSLSIGNCERT , "sm2_sign.crt" );
44
- curl_easy_setopt (curl , CURLOPT_SSLSIGNKEY , "sm2_sign.key" );
45
- curl_easy_setopt (curl , CURLOPT_SSLENCCERT , "sm2_enc.crt" );
46
- curl_easy_setopt (curl , CURLOPT_SSLENCKEY , "sm2_enc.key" );
43
+ curl_easy_setopt (curl , CURLOPT_SSLSIGNCERT , "sm2_sign.crt" );
44
+ curl_easy_setopt (curl , CURLOPT_SSLSIGNKEY , "sm2_sign.key" );
45
+ curl_easy_setopt (curl , CURLOPT_SSLENCCERT , "sm2_enc.crt" );
46
+ curl_easy_setopt (curl , CURLOPT_SSLENCKEY , "sm2_enc.key" );
47
47
48
- /* optional */
49
- curl_easy_setopt (curl , CURLOPT_SSL_VERIFYPEER , 0 );
50
- curl_easy_setopt (curl , CURLOPT_SSL_VERIFYHOST , 0 );
48
+ /* optional */
49
+ curl_easy_setopt (curl , CURLOPT_SSL_VERIFYPEER , 0 );
50
+ curl_easy_setopt (curl , CURLOPT_SSL_VERIFYHOST , 0 );
51
51
52
- res = curl_easy_perform (curl );
52
+ res = curl_easy_perform (curl );
53
53
54
- if (res != CURLE_OK )
55
- fprintf (stderr , "curl_easy_perform() failed: %s\n" ,
56
- curl_easy_strerror (res ));
54
+ if (res != CURLE_OK )
55
+ fprintf (stderr , "curl_easy_perform() failed: %s\n" ,
56
+ curl_easy_strerror (res ));
57
57
58
- curl_easy_cleanup (curl );
59
- }
58
+ curl_easy_cleanup (curl );
59
+ }
60
60
61
- return 0 ;
61
+ return 0 ;
62
62
}
63
- // gcc https-tlcp-doublecerts.c -o https-tlcp-doublecerts -I/usr/local/curl/include -lcurl -L/usr/local/curl/lib -Wl,-rpath=/usr/local/curl/lib
63
+ // gcc https-tlcp-doublecerts.c -o https-tlcp-doublecerts \
64
+ //-I/usr/local/curl/include -lcurl -L/usr/local/curl/lib \
65
+ //-Wl,-rpath=/usr/local/curl/lib
0 commit comments