Curl HttpBuilder:“;对等方未经身份验证”;,在《邮递员》中工作很好

Curl HttpBuilder:“;对等方未经身份验证”;,在《邮递员》中工作很好,curl,paypal,groovy,postman,httpbuilder,Curl,Paypal,Groovy,Postman,Httpbuilder,我在访问paypal(沙盒)API时遇到问题。代码 import groovyx.net.http.* import static groovyx.net.http.ContentType.* import static groovyx.net.http.Method.* HTTPBuilder http = new HTTPBuilder( 'https://api.sandbox.paypal.com/v1' ) http.auth.basic clientId, secret http.

我在访问paypal(沙盒)API时遇到问题。代码

import groovyx.net.http.*
import static groovyx.net.http.ContentType.*
import static groovyx.net.http.Method.*

HTTPBuilder http = new HTTPBuilder( 'https://api.sandbox.paypal.com/v1' )
http.auth.basic clientId, secret
http.headers.Accept = 'application/json'
http.headers[ 'Accept-Language' ] = 'en_US'
http.request( POST ){
  uri.path = '/oauth2/token'
  requestContentType = URLENC
  body = 'grant_type=client_credentials'

  response.success = { resp, json ->
    println json
  } 
}
在我的本地计算机上

javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
如果我运行
curl

curl -v https://api.sandbox.paypal.com/v1/oauth2/token -H "Accept: application/json" -H "Accept-Language: en_US" -H "Authorization: Basic {base64 text}=" -d "grant_type=client_credentials"
我得到:

curl: (35) error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
如果我在
Postman
中运行相同的查询,它运行得很顺利

我错过了什么

更新:

如果添加
-Djavax.net.debug=ssl:handshake
,将显示以下调试信息

http-bio-8880-exec-3,写入:TLSv1握手,长度=149 http-bio-8880-exec-3,读取:TLSv1警报,长度=2 http-bio-8880-exec-3 ,RECV TLSv1警报:
致命的, 握手失败 http-bio-8880-exec-3,称为closeSocket() http-bio-8880-exec-3,处理异常:javax.net.ssl.SSLHandshakeException:收到致命警报:握手失败


你试过卷曲的开关吗?@tim_yates我试过了
ignoresslessues()
,但没有luck@Opal
-k
更改nothing@injecteer是否有复制的步骤/说明?