Hi, I want to connect to an exchange server 2003 via SSL.
I've tried this code (using https in the server uri):
Const mailboxUri As String = "https://myExchange2003Server/exchange/myUser"
Const username As String = "myUser"
Const password As String = "myPassword"
Const domain As String = "myDomain"
Sub test()
Try
' Create instance of ExchangeClient class by giving credentials
Dim credential As NetworkCredential = New NetworkCredential(username, password, domain)
Using client As ExchangeClient = New ExchangeClient(mailboxUri, credential)
'...
End Using
Catch ex As Exception
addMessage(ex.Message)
End Try
End Sub
But I obtain this error:
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
Can be a problem in my exchange server (not well configured) or is there something wrong on my code?
What I need to do to connect to an exchange server via SSL? Using https in the uri is enough or I need to do something else? In your documentarion I've found nothing about SSL or server port for the ExchangeClient class.
Thank you!