mutual-authentication

How to use private key on a PKCS#11 module instead of perivate key file for mutual-authentication in OpenSSL?

99封情书 提交于 2019-12-08 03:24:08
问题 I've a simple SSL client that uses OpenSSL library. My server requires client authentication & so I've to set client's private key stored in a password protected PEM file. I use the following code for this purpose: /* set the private key from KeyFile */ if (SSL_CTX_use_PrivateKey_file(ctx, KeyFile, SSL_FILETYPE_PEM) <= 0) { ERR_print_errors_fp(stderr); abort(); } /* verify private key */ if ( !SSL_CTX_check_private_key(ctx) ) { fprintf(stderr, "Private key does not match the public

How to use private key on a PKCS#11 module instead of perivate key file for mutual-authentication in OpenSSL?

僤鯓⒐⒋嵵緔 提交于 2019-12-07 23:16:29
I've a simple SSL client that uses OpenSSL library. My server requires client authentication & so I've to set client's private key stored in a password protected PEM file. I use the following code for this purpose: /* set the private key from KeyFile */ if (SSL_CTX_use_PrivateKey_file(ctx, KeyFile, SSL_FILETYPE_PEM) <= 0) { ERR_print_errors_fp(stderr); abort(); } /* verify private key */ if ( !SSL_CTX_check_private_key(ctx) ) { fprintf(stderr, "Private key does not match the public certificate\n"); abort(); } Now I want to know how can I establish a SSL connection using private key stored on a

Storing a .p12 certificate in keychain to use later

放肆的年华 提交于 2019-12-07 12:08:33
问题 I am trying to follow the apple docs for dealing with client p12 certificates here: https://developer.apple.com/library/ios/documentation/Security/Conceptual/CertKeyTrustProgGuide/iPhone_Tasks/iPhone_Tasks.html#//apple_ref/doc/uid/TP40001358-CH208-SW13 I have successfully loaded a .p12 cert from the file system: - (SecIdentityRef)getClientCertificate:(NSString *) certificatePath { SecIdentityRef identity = nil; NSData *PKCS12Data = [NSData dataWithContentsOfFile:certificatePath]; CFDataRef

How to implement mutual authentication for client in Openssl?

允我心安 提交于 2019-12-07 07:45:30
What function calls do I need to do for mutual authentication ? I have searched a lot, but didn't find anything useful. Can anybody help me doing this ? The function calls you are looking for are the SSL_set_verify() family. On the server side, specifying SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT requires a valid client certificate. On the client side, just SSL_VERIFY_PEER is needed. Both sides must also ensure that anonymous ciphers are not allowed in their specified cipher list (set with SL_CTX_set_cipher_list() ). 来源: https://stackoverflow.com/questions/3575889/how-to-implement

Storing a .p12 certificate in keychain to use later

穿精又带淫゛_ 提交于 2019-12-05 21:15:07
I am trying to follow the apple docs for dealing with client p12 certificates here: https://developer.apple.com/library/ios/documentation/Security/Conceptual/CertKeyTrustProgGuide/iPhone_Tasks/iPhone_Tasks.html#//apple_ref/doc/uid/TP40001358-CH208-SW13 I have successfully loaded a .p12 cert from the file system: - (SecIdentityRef)getClientCertificate:(NSString *) certificatePath { SecIdentityRef identity = nil; NSData *PKCS12Data = [NSData dataWithContentsOfFile:certificatePath]; CFDataRef inPKCS12Data = (__bridge CFDataRef)PKCS12Data; CFStringRef password = CFSTR("password"); const void *keys

Signing certificate request with certificate authority

一笑奈何 提交于 2019-12-05 05:05:28
I want to use TLS mutual authentication to authenticate a client on a API made in go. I've created a certificate authority, and let's say Bob has a key pair he wants to use with the client. Bob created a certificate request and want me to validate his certificate in order to be authorized and authenticated on the API. I've used this to create my Certificate Authority : openssl genrsa -aes256 -out ca.key 4096 openssl req -new -x509 -sha256 -days 730 -key ca.key -out ca.crt Bob used this to create his certificate and certificate request : openssl genrsa -out bob.key 4096 openssl req -new -key

Spring Boot in Azure - Client Certificate in Request Header

天涯浪子 提交于 2019-12-04 17:04:05
We currently implemented mutual authentication in our Spring Boot application and need to deploy it in Azure. Azure's loadbalancer redirects the client certificate (Base64 encoded) in the request header field "X-ARR-ClientCert" and Spring is not able to find it there. => Authentication fails The microsoft documentation shows how to handle this in a .NET application: https://docs.microsoft.com/en-gb/azure/app-service-web/app-service-web-configure-tls-mutual-auth I tried to extract the certificate from the header in an OncePerRequestFilter and set it to the request like this: public class

How to implement client certificates and server authentication for iOS

限于喜欢 提交于 2019-12-04 12:03:54
问题 I have recently gone through an extremely arduous process to build something that should be very simple yet appears to be essentially un-findable in any one place. I’d like to try to put everything here to ask if I’m doing anything wrong and, if not, to help anyone who needs this information. Background: The product/service for which I was trying to provide security is built around WCF services on a Windows server that are accessible only though custom client apps on a PC or an iPad. One

How to implement client certificates and server authentication for iOS

我怕爱的太早我们不能终老 提交于 2019-12-03 07:54:27
I have recently gone through an extremely arduous process to build something that should be very simple yet appears to be essentially un-findable in any one place. I’d like to try to put everything here to ask if I’m doing anything wrong and, if not, to help anyone who needs this information. Background: The product/service for which I was trying to provide security is built around WCF services on a Windows server that are accessible only though custom client apps on a PC or an iPad. One server per customer, no browser access. Everything was already TLS secured with authentication and

IOS Mutual Authentication

ⅰ亾dé卋堺 提交于 2019-12-02 20:59:20
I'm trying to implement mutual authentication in IOS 5 but i'm having troubles: {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,