html52.com
我爱小程序-开发者交流社区

部分安卓报request:fail ssl hand shake error 。

问题模块 框架类型 API/组件名称 终端类型 操作系统 微信版本 基础库版本
API和组件 小程序 wx.request 客户端 Android 6.6.2 1.9.8



在对小程序进行开发的时候,对request api 进行测试,


通过二维码预览的形式,部分安卓手机出现 request:fail ssl hand shake error 错误(Oppo A31u,红米2)。而小米max1和苹果手机可以正确显示,开发工具正常显示。



环境:

腾讯云,证书从腾讯云申请。


请各位前辈给点提示,怎么配置才是正确的。


部分httpd-ssl.conf配置内容



#   General setup for the virtual host

DocumentRoot "/opt/lampp/htdocs"

ServerName www.example.com:443

ServerAdmin you@example.com

ErrorLog "/opt/lampp/logs/error_log"

TransferLog "/opt/lampp/logs/access_log“


SSLEngine on


SSLProtocol -all +TLSv1 +TLSv1.1 +TLSv1.2

       

SSLCertificateFile "/opt/lampp/etc/ssl/2_peipeixiu.cn.crt"


SSLCertificateKeyFile "/opt/lampp/etc/ssl/3_peipeixiu.cn.key"


SSLCertificateChainFile "/opt/lampp/etc/ssl/1_root_bundle.crt"


代码如下:

wx.request({

url: 'https://peipeixiu.cn', //仅为示例,并非真实的接口地址

data: {

x: '',

y: ''

},

method: 'GET',

header: {

'content-type': 'application/json' // 默认值

},

success: function (res) {

console.log(res.data)

wx.showModal({

title: 'Message',

content: res.data,

})

},

fail:function(error){

wx.showModal({

title: 'Error',

content: error.errMsg,

})

}

})


评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付