php代码转换为java 10
$b='https://www.sandlife.com.cn/Oauth/user';$post='access_token='.$res['access_token'...
$b='https://www.sandlife.com.cn/Oauth/user';
$post='access_token='.$res['access_token'];
$curl = curl_init();
curl_setopt($curl,CURLOPT_URL,$b);
curl_setopt($curl, CURLOPT_PORT, 443);
curl_setopt($curl, CURLOPT_SSLVERSION, 3);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); //信任任何证书
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); // 检查证书中是否设置域名,0不验证
curl_setopt($curl, CURLOPT_VERBOSE, 1); //debug模式
curl_setopt($curl, CURLOPT_SSLCERT, "E:\\htdocs\\xxxxxx.crt"); //client.crt文件路径
curl_setopt($curl, CURLOPT_SSLCERTPASSWD, "sand123"); //client证书密码
curl_setopt($curl, CURLOPT_SSLKEY, "E:\\htdocs\\xxxxx.key"); //key文件路径
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
$ret = curl_exec($curl);
curl_close($curl);
请帮忙下 展开
$post='access_token='.$res['access_token'];
$curl = curl_init();
curl_setopt($curl,CURLOPT_URL,$b);
curl_setopt($curl, CURLOPT_PORT, 443);
curl_setopt($curl, CURLOPT_SSLVERSION, 3);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); //信任任何证书
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); // 检查证书中是否设置域名,0不验证
curl_setopt($curl, CURLOPT_VERBOSE, 1); //debug模式
curl_setopt($curl, CURLOPT_SSLCERT, "E:\\htdocs\\xxxxxx.crt"); //client.crt文件路径
curl_setopt($curl, CURLOPT_SSLCERTPASSWD, "sand123"); //client证书密码
curl_setopt($curl, CURLOPT_SSLKEY, "E:\\htdocs\\xxxxx.key"); //key文件路径
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
$ret = curl_exec($curl);
curl_close($curl);
请帮忙下 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询