SSL Server Certificate Verification Failed
When establishing an SSL connection, the server presents a certificate to the client, which is then validated against criteria such as validity dates, whether the common name (CN) matches the remote host, and whether the issuing authority is trusted. If any of these checks fail, the error "server certificate verification failed" is returned.
To resolve this issue, you can:
- Install a valid server certificate on the server.
- Accept the certificate programmatically.
- Install the public key of the certificate's issuing authority into the trusted CA store on the client machine.
To accept the certificate programmatically, you can either:
- Set the SSLAcceptServerCert property to the certificate instance.
- Handle the SSLServerAuthentication event, examine the server certificate, and set the Accept parameter to true.
If you are using BizTalk adapters or SQL Server Integration Services (SSIS) tasks, you may also set the SSLAcceptServerCert property to ANY or ALL to accept any certificate presented by the server. In version 8 and later, you can also configure the components to accept any certificate by setting the AcceptAnyServerCert setting.
For example, setting this property using an encoded public key certificate:
component.SSLAcceptServerCert = new Certificate(CertStoreTypes.cstPublicKeyBlob,
"-----BEGIN CERTIFICATE-----MIIDojCCAwugAwIBAgIJAPC...", "", "")
// To obtain the encoded certificate you may examine the
CertEncoded parameter of the SSLServerAuthentication event
Or within the SSLServerAuthentication event:
e.Accept = true
Warning Accepting non-trusted certificates may introduce a security risk. While the data will still be encrypted, the identity of the server will not be authenticated.
We appreciate your feedback. If you have any questions, comments, or suggestions about this article please contact our support team at support@nsoftware.com.