anqiong
anqiong
  • 发布:2021-12-30 15:53
  • 更新:2021-12-30 16:07
  • 阅读:433

双向认证配置好后iOS访问没有问题,安卓报错

分类:uni-app
        var cerbase64 = 'data:cert/pem;base64,MIIDFTCCAf0CCQCwyVZ+NoXjUzANBgkqhkiG9w0BAQsFADBUMQswCQYDVQQGEwJDTjELMAkGA1UECAwCQkoxCzAJBgNVBAcMAkJKMQ0wCwYDVQQKDARjcGxoMQ0wCwYDVQQLDARjcGxoMQ0wCwYDVQQDDAR4dGdoMB4XDTIxMDEyMDA4MTMzNFoXDTMxMDExODA4MTMzNFowRTELMAkGA1UEBhMCQ04xCzAJBgNVBAgMAkJKMQswCQYDVQQHDAJCSjENMAsGA1UECgwEY3BsaDENMAsGA1UECwwEeHRnaDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJkTfBrAxVizyo0dGKdbhzRoUKcltoMv3KwvyaT6X8kg+QQAXEVRzdNXO6oexlY/AgNYsFLlacfXiYcxA4zyTizNJRHOfabCHCa3RCZu96WJB3w1swcaIvF7vmMOUgmcWkJb1V+JoHTa4lZ8dfuuALW60ZMaLTaSGDbNa0zC3kaUDOCTFSNNqgG6VA8fp5nVYvzBl37PVC5LBLSEyi98ONERkLx8UklRby2AohhkSsovOwOBBeH6516DIsNnf/htmdoGzFa54CcT5xUNpFPPne+liE4VuWriTeVfNVSQFNUHuiuvpv9PrC+qdumLvLvRH7kGcwgZFmVi6m4jNaim46sCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEA3gU9psJuuhtWpSAF8KDNcHYdcF2FX6TF6aNutVVWljxsEi5O4d6T2C7oD6YZ+Lzh4MNQQOR1m/Heedk5+GgP/R/qGQdUZ0CYKAuLJBysoyDUK1TIyf7WjIHMgR396b7R81lmMwPdJ6elfNJ/8RNEn3yF9tDfxf3RESxSzBTKpbT4gBn2W8ohJiY9ZqvR4YWCrqqKKgZi/mGH5E6r+YBiEv0nmWGggud0SXcPWpTU+eAj/'  
        var p12base64 = 'data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({
certificates: [{
'host': 'XXX',
'client': p12base64,
'clientPassword': 'Xtgh@20200120',
'server': [cerbase64],
}],
success ({code}) {
console.log(code)
}
});
配置好后code为0 iOS接口访问都没问题,但是安卓访问报错
request:fail abort statusCode:-1 Hostname XXX not verified:\n certificate: sha256/l9ZJ/1NxjB4qpcD8jFmAoZdqfHKbeYjjdylMIki+y0I=\n DN: OU=xtgh,O=cplh,L=BJ,ST=BJ,C=CN\n subjectAltNames: [

2021-12-30 15:53 负责人:无 分享
已邀请:
DCloud_Android_DQQ

DCloud_Android_DQQ

还是需要提供一下 具体的base64 和 client内容。
你可以删减脱敏。 但是数据格式要体现出来

DCloud_Android_DQQ

DCloud_Android_DQQ

在这里回复你把。 host 不能是ip地址。
https是基于域名的。

  • sheng_se

    那本机测试的话,有什么解决方法吗

    2021-12-31 14:38

该问题目前已经被锁定, 无法添加新回复