SelectServerCertStore Method
Selects the store where to search server certificate.
This method is used for testing validity of server certificates. However, this
method is required only if you're implementing your own certificate stores.
By default (VerifyServerCert=False),
MailBee does not check server certificates. However, if VerifyServerCert=True,
MailBee will determine whether the server certificate is trusted during connecting
to the server. If the certificate is not trusted, the connection is refused.
MailBee concludes the certificate is trusted if it is signed by well-known authority.
Default store of well-known authorities is "ROOT" system store. You
can access this store through "Control panel/Internet options/Content/Certificates/Trusted
Root Certification Authorities" panel. However, you can always select your
own trusted store using SelectServerCertStore method.
Note: This method will make effect only if it called
BEFORE connecting to the mail server. Also VerifyServerCert must be True.
blnResult = ObjectName.SelectServerCertStore(Path, StoreType, [Options]) |
Parameters: | ||
Path As String | Filename or system registry name of
the store. Allowed system registry names are:
|
|
StoreType As Long | Type of the certificate store to select
certificate from. Allowed values are:
|
|
Options As Long | (optional) By default, server certificate
is considered "trusted" by the store if certificate issuer name
is found in the store. However, you may override this behavior. If Options
is specified, can be any combination of the following values:
|
|
Return value As Boolean | Always True |
Usage example:
Dim Mailer 'Using visual basic to create object Set Mailer = CreateObject("MailBee.SMTP") 'Using ASP to create object 'Set Mailer = Server.CreateObject("MailBee.SMTP") 'In ASP use Response.Write instead of MsgBox Mailer.EnableLogging = True Mailer.LogFilePath = "C:\Temp\smtp_log.txt" Mailer.ClearLog Mailer.LicenseKey = "put your license key here" ' Set SSL connection over STARTTLS command Mailer.SSL.Enabled = True Mailer.SSL.UseStartTLS = True ' Select system's TRUSTED ROOT as a source of trusted authorities Mailer.SSL.SelectServerCertStore("ROOT", 0) ' select active certificate Mailer.SSL.VerifyServerCert = True
Mailer.Connect "mail.server.com", 465 MsgBox Mailer.SSL.ServerCert.IssuedTo ' display info on the certificate owner
See Also:
Copyright © 2002-2024, AfterLogic Corporation. All rights reserved.