标签: mutual-authentication

与Web服务的相互身份验证

目前,只要客户端使用Web浏览器访问网站,我就成功实现了相互身份验证安全性,因为浏览器会为您处理所有证书交换.现在,我需要创建一个安全的界面,用户可以使用服务器所需的相互身份验证通过HTTPS访问Web服务.

首先,有没有人知道的资源可以帮助我吗?我已经找了很长时间没找到.任何其他人可以给我如何解决这个问题的提示?

其次,我认为我最大的障碍是我对如何处理证书缺乏了解.如何协商接受服务器密钥并将自己的密钥提供给服务器?这是Java.

java authentication web-services pki mutual-authentication

22
推荐指数
4
解决办法
4万
查看次数

使用urllib2的客户端证书

我需要在服务器和远程Web服务之间创建一个安全通道.我将使用带有客户端证书的HTTPS.我还需要验证远程服务提供的证书.

  1. 如何在urllib2中使用自己的客户端证书?

  2. 我需要在代码中做些什么才能确保远程证书正确无误?

python ssl certificate urllib2 mutual-authentication

19
推荐指数
3
解决办法
2万
查看次数

Delphi相互认证

我使用WinINet库连接到一个网站.

使用Internet Explorer(Win10)它可以工作并向我显示选择要使用的证书的消息.

这是我调用的delphi代码:

FUNCTION TRAD.lastOrganization(): Integer;
VAR
  js:TlkJSONobject;
  ws: TlkJSONstring;
  url, resp: String;
  count,statusCodeLen, bodyCodeLen: Cardinal;
  header,tmp: String;
  buffer, body: String;
  statusCode: ARRAY [0 .. 1024] OF Char;
  bodyCode: ARRAY [0 .. 1024] OF Char;
  UrlHandle: HINTERNET;
BEGIN
  buffer := '00000000000000000000';
  url := contextUrl + '/rest/organization/count';
  UrlHandle := InternetOpenUrl(NetHandle, PChar(url), nil, 0, INTERNET_FLAG_RELOAD, 0);
  IF NOT ASSIGNED(UrlHandle) THEN
    SHOWMESSAGE('Unable to read the amount of Organization using the URL ' + url + ': ' +  SysErrorMessage(GetLastError));
  statusCodeLen := Length(statusCode); …
Run Code Online (Sandbox Code Playgroud)

delphi cryptoapi mutual-authentication microsoft-edge

18
推荐指数
1
解决办法
732
查看次数

与Tomcat 7的相互认证

我正在尝试设置在Tomcat 7中运行的Java Web服务以使用相互(双向)身份验证.似乎无论我做什么,连接到安全端口上的服务都无法正常工作.

这是我创建证书和密钥库所做的事情:

//create the key and certificate for the tomcat server.
keytool -genkey -v -alias tomcat -keyalg RSA -validity 3650 -keystore tomcat.keystore

//create the key and certificate for the client machine.
keytool -genkey -v -alias clientkey -keyalg RSA -storetype PKCS12 -keystore client.p12

//export the client key
keytool -export -alias clientkey -keystore client.p12 -storetype PKCS12 -rfc -file client.cer

//import the client key into the server keystore
keytool -import -v -file client.cer -keystore tomcat.keystore
Run Code Online (Sandbox Code Playgroud)

这是server.xml文件中的连接器:

<Connector port="8443"
    maxThreads="150"
    scheme="https"
    secure="true" …
Run Code Online (Sandbox Code Playgroud)

java ssl tomcat mutual-authentication

17
推荐指数
1
解决办法
3万
查看次数

IOS相互认证

我正在尝试在IOS 5中实现相互身份验证,但我遇到了麻烦:

{NSUnderlyingError = "Error Domain=kCFErrorDomainCFNetwork Code=-1200 \"An SSL error has occurred and a secure connection to the server cannot be made.\" UserInfo=0x18d830 {NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., _kCFNetworkCFStreamSSLErrorOriginalValue=-9800, _kCFStreamPropertySSLClientCertificateState=0, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSErrorFailingURLStringKey=https://192.168.24.110:8081/t01.json, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0xceaa2d0>, NSErrorFailingURLKey=https://192.168.24.110:8081/t01.json}
Run Code Online (Sandbox Code Playgroud)

我为服务器生成密钥,证书和pkcs12(自签名或假冒CA我总是遇到这个问题)和客户端这样:

openssl genrsa -out client.key 1024
openssl req -new -key client.key -out client.csr

self-signed
openssl req -new -key ca.key -x509 -days 1095 -out ca.crt

CA signed
openssl …
Run Code Online (Sandbox Code Playgroud)

authentication openssl ios mutual-authentication

12
推荐指数
1
解决办法
3833
查看次数

警告:找不到合适的证书 - 继续没有客户端身份验证

团队在尝试使用HTTPS完成相互握手时遇到以下问题

main, READ: TLSv1.2 Handshake, length = 30
*** CertificateRequest
Cert Types: RSA, DSS, ECDSA
Supported Signature Algorithms: SHA1withRSA, SHA1withDSA, SHA1withECDSA, SHA256withRSA, Unknown (hash:0x4, signature:0x2), SHA256withECDSA, SHA384withRSA, Unknown (hash:0x5, signature:0x2), SHA384withECDSA
Cert Authorities:
<Empty>
main, READ: TLSv1.2 Handshake, length = 4
*** ServerHelloDone
Warning: no suitable certificate found - continuing without client authentication
*** Certificate chain
<Empty>
Run Code Online (Sandbox Code Playgroud)

我的JAVA课程如下

public class ClientCustomSSL {

    @SuppressWarnings("deprecation")
    public final static void main(String[] args) throws Exception {
        // Trust own CA and all self-signed certs …
Run Code Online (Sandbox Code Playgroud)

java ssl mutual-authentication

10
推荐指数
1
解决办法
2万
查看次数

OpenSSL 错误:02001002:系统库:fopen:没有这样的文件或目录,找不到密钥,密码错误或文件格式错误,git bash 与 cmd

我有一个使用相互身份验证公开网址的应用程序。现在我正在编写一个Python脚本,它使用Popen运行curl命令来连接到应用程序并获取所需的数据。但是当我运行 python 脚本时,出现以下错误。

curl:(58)无法加载PEM客户端证书,OpenSSL错误错误:02001002:系统库:fopen:没有这样的文件或目录,(找不到密钥,密码错误或文件格式错误?)

我正在 Windows 7 机器上运行该应用程序。我安装了curl 和openssl。下面给出了运行的命令

curl -v https://localhost:9400/<URL> -H "Connection:close" --cacert 'C:/local_cert/root.crt' --cert 'C:/local_cert/client.crt' --key 'C:/local_cert/client.key' --pass client_key_passwd
Run Code Online (Sandbox Code Playgroud)

现在为了进行测试,我在 Windows 版 Git Bash 中运行了相同的命令。我成功得到了结果。但是当我在 Git Cmd for windows 或 Windows Cmd 中运行相同的命令时,我得到了与上述相同的错误。

我已经检查了证书的路径是否正确,它们是PEM格式,我安装了openssl和curl。由于某些原因,我无法使用Requestsurllib3 python pacakges,只能使用curl。上面的内容让我相信Windows CmdGit Cmd for windows缺少一些设置,但我不确定它可能是什么。

python bash curl openssl mutual-authentication

10
推荐指数
1
解决办法
4万
查看次数

如何使用ServiceStack中的证书对客户端进行身份验证?

我正在探索使用ServiceStack作为WCF的替代方案.我的一个要求是服务器和客户端必须使用证书进行相互身份验证.客户端是一项服务,因此我无法使用涉及用户输入的任何类型的身份验证.此外,客户端需要能够使用单声道在Linux上运行,因此Windows身份验证已经完成.

我使用netsh.exe将服务器证书绑定到服务器端口,验证客户端是否获取服务器证书并使用wireshark加密数据.但是我不能为我的生活弄清楚如何配置服务器以要求客户端证书.

有些人建议使用请求过滤器来验证客户端证书,但这似乎非常低效,因为每个请求都会检查客户端证书.性能是非常重要的.创建自定义IAuthProvider似乎很有希望,但所有文档和示例都面向涉及用户交互的身份验证类型,而不是证书.

https://github.com/ServiceStack/ServiceStack/wiki/Authentication-and-authorization

是否可以使用证书通过自托管ServiceStack服务相互验证客户端和服务器?

这是我的测试服务供参考.

public class Host : AppHostHttpListenerBase
{
    public Host()
        : base("Self-hosted thing", typeof(PutValueService).Assembly)
    {
        //TODO - add custom IAuthProvider to validate the client certificate?
        this.RequestFilters.Add(ValidateRequest);

        //add protobuf plugin
        //https://github.com/ServiceStack/ServiceStack/wiki/Protobuf-format
        Plugins.Add(new ProtoBufFormat());

        //register protobuf
        base.ContentTypeFilters.Register(ContentType.ProtoBuf,
                (reqCtx, res, stream) => ProtoBuf.Serializer.NonGeneric.Serialize(stream, res),
                ProtoBuf.Serializer.NonGeneric.Deserialize);
    }

    public override void Configure(Funq.Container container)
    {}

    void ValidateRequest(IHttpRequest request, IHttpResponse response, object dto)
    {
        //TODO - get client certificate?
    }
}

[DataContract]
[Route("/putvalue", "POST")]
//dto
public class PutValueMessage : IReturnVoid
{
    [DataMember(Order=1)]
    public …
Run Code Online (Sandbox Code Playgroud)

c# client-certificates servicestack mutual-authentication

9
推荐指数
1
解决办法
2396
查看次数

具有相互身份验证的 cUrl

我正在尝试对第三方服务器执行 cUrl。他们为我提供了一个 p12 文件,我将其安装在浏览器中。使用浏览器时,我收到服务器的响应。从 Linux 终端执行 cUrl 时,出现握手错误。

我将 .p12 提取到密钥和证书,然后运行以下命令:

curl --key client.key --cert client.crt -X GET -v https://x.x.x.x:xxxx/folder/endpoint

并得到如下回复:

Note: Unnecessary use of -X or --request, GET is already inferred.
*   Trying x.x.x.x...
* TCP_NODELAY set
* Connected to x.x.x.x (x.x.x.x) port xxxx (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello …
Run Code Online (Sandbox Code Playgroud)

curl ssl-certificate mutual-authentication

9
推荐指数
1
解决办法
2万
查看次数

是否有任何公共 Web 服务可以检查 MTLS 证书并使用 application/json 进行响应

另一个线程指出了一些需要客户端 MTLS 证书、接受任何证书、然后使用有关 SSL 握手/证书的信息进行响应的服务。

检查客户端证书的 HTTPS 测试服务器

这些端点都返回 HTML。有谁知道类似的返回 application/json 的东西吗?

ssl web-services mutual-authentication

9
推荐指数
1
解决办法
4152
查看次数