小程序安卓机访问数据失败request:fail ssl hand shake error~已解决

小程序开发遇到的问题: 苹果机可以访问到数据,安卓机不可以

首先,打开在真机打开小程序调试


在wx.request   回调打印 

wx.request({
          url: '*****/Api/small_app_user_info',
          method: 'POST',
          data: {
          	gzhCode: '45B06C50A8D',
                code: res.code,
                refereeUid: ''
           },
           header: {
      		'content-type': 'application/json'
  	   },
           success: function (res) {
           	console.log(res)
           },
           fail: function (e) {
           	console.log(e)
           }
         })


然后在真机上面打印报错   request:fail ssl hand shake error

解决办法:

https://www.myssl.cn/tools/merge-pem-cert.html

ssl证书配置需要使用pem,不使用crt, 之前一直不行,后来配置修改成 pem就好了

#  ssl_certificate /etc/ssl/xxx.crt;
   ssl_certificate /etc/ssl/xxx.pem;

pem 可以通过crt+key在线合成,合作网址:

https://www.myssl.cn/tools/merge-pem-cert.html


猜你喜欢

转载自blog.csdn.net/settingSun66/article/details/78707298