使用Fiddler获取OAuth2认证的access token时候返回502

微软动态CRM专家罗勇 ,回复322或者20190402可方便获取本文,同时可以在第一间得到我发布的最新博文信息,follow me!

我这里Fiddler的Composer功能来获取OAuth2 认证的access token:

POST https://demo.luoyong.me/api/oauth2/token

Request Body:

grant_type=client_credentials&client_id=###################&client_secret=########

发现报错如下:

HTTP/1.1 502 Fiddler - Connection Failed
Date: Tue, 02 Apr 2019 02:08:43 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
Cache-Control: no-cache, must-revalidate
Timestamp: 10:08:43.362

[Fiddler] The connection to 'demo.luoyong.me' failed. <br />System.Security.SecurityException Failed to negotiate HTTPS connection with server.fiddler.network.https&gt; HTTPS handshake to soa-demo.luoyong.me (for #2) failed. System.IO.IOException Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. &lt; An existing connection was forcibly closed by the remote host

 这是咋回事呢?后来我找到一个 Some HTTPS sites are unaccessible when using Fiddler 

Fabio 提的方法如下,我验证了有效,

I was able to fix it by enabling the TLS1.2 protocol which is not enabled by default for outgoing connections (Tools / Fiddler Options.. / HTTPS / click on protocols list)

 我补充个截图如下,打开Fiddler的Options,设置HTTPS的协议Protocol支持 tls1.2:

使用Fiddler获取OAuth2认证的access token时候返回502

 

上一篇:1.Spring Security 5.1更新说明


下一篇:OAuth2简易实战(四)-Github社交联合登录