【发布时间】:2018-05-03 11:18:39
【问题描述】:
我指的是这个问题:https://forum.ionicframework.com/t/ionic-native-http-ssl-client-based-authentification/129596
任何想法如何在 ionic 框架内实现基于 ssl 客户端的身份验证(相互 tls)?我使用离子原生 http 插件。我将 .cer 文件放在了platforms/android/asset 文件夹中。
this.http.acceptAllCerts(true);
this.http.enableSSLPinning(false);
this.http.get('https://someip/backend/all', {}, {})
.then(data => {
console.log("data",data)
})
.catch(error => {
console.log("error",error);
});
目前,http 请求并未随每个请求发送所需的 ssl 证书。
<html>
<head><title>400 No required SSL certificate was sent</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<center>No required SSL certificate was sent</center>
<hr><center>nginx/1.10.3 (Ubuntu)</center>
</body>
</html>
使用 angular/http 发送 http 请求时同样的问题
离子信息
cli packages: (C:\Users\myname\AppData\Roaming\npm\node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
全局包:
cordova (Cordova CLI) : not installed
本地包:
@ionic/app-scripts : 3.1.8
Cordova Platforms : android 6.3.0 browser 5.0.0
Ionic Framework : ionic-angular 3.9.2
系统:
Android SDK Tools : 26.1.1
Node : v6.11.3
npm : 3.10.10
OS : Windows 10
环境变量:
ANDROID_HOME : C:\Users\myname\Android\sdk
杂项:
backend : pro
【问题讨论】:
-
您需要添加更多信息,请使用
ionic info=> 您要使用哪个平台? -
我添加了请求的离子信息输出,我正在尝试构建一个使用基于客户端的 ssl 身份验证的 android apk。问题是如何发送包含我的证书的 http 请求(格式 .p12 或其他)
标签: ssl ionic-framework https ionic-native mutual-authentication