improved error message when client cert return failure
This commit is contained in:
		@@ -277,12 +277,15 @@ int cert_stuff(struct connectdata *conn,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    file_type = do_file_type(cert_type);
 | 
					    file_type = do_file_type(cert_type);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#define SSL_CLIENT_CERT_ERR \
 | 
				
			||||||
 | 
					    "unable to use client certificate (no key found or wrong pass phrase?)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    switch(file_type) {
 | 
					    switch(file_type) {
 | 
				
			||||||
    case SSL_FILETYPE_PEM:
 | 
					    case SSL_FILETYPE_PEM:
 | 
				
			||||||
      /* SSL_CTX_use_certificate_chain_file() only works on PEM files */
 | 
					      /* SSL_CTX_use_certificate_chain_file() only works on PEM files */
 | 
				
			||||||
      if(SSL_CTX_use_certificate_chain_file(ctx,
 | 
					      if(SSL_CTX_use_certificate_chain_file(ctx,
 | 
				
			||||||
                                            cert_file) != 1) {
 | 
					                                            cert_file) != 1) {
 | 
				
			||||||
        failf(data, "unable to set certificate file (wrong password?)");
 | 
					        failf(data, SSL_CLIENT_CERT_ERR);
 | 
				
			||||||
        return 0;
 | 
					        return 0;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      break;
 | 
					      break;
 | 
				
			||||||
@@ -294,7 +297,7 @@ int cert_stuff(struct connectdata *conn,
 | 
				
			|||||||
      if(SSL_CTX_use_certificate_file(ctx,
 | 
					      if(SSL_CTX_use_certificate_file(ctx,
 | 
				
			||||||
                                      cert_file,
 | 
					                                      cert_file,
 | 
				
			||||||
                                      file_type) != 1) {
 | 
					                                      file_type) != 1) {
 | 
				
			||||||
        failf(data, "unable to set certificate file (wrong password?)");
 | 
					        failf(data, SSL_CLIENT_CERT_ERR);
 | 
				
			||||||
        return 0;
 | 
					        return 0;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      break;
 | 
					      break;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user