Results 1 to 3 of 3

Thread: FTPWebRequest using SSL

  1. #1

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    FTPWebRequest using SSL

    I'm having problems accessing a webserver using SSL. It works fine without it, but when I set FTPWebRequest.EnableSSL = True, I get the following error:

    "The remote certificate is invalid according to the validation procedure"

    The FTP server I'm trying to connect to does not require the client to have a certificate. It issues it's own certificate. Does anyone know what I have to do to get this to work?
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: FTPWebRequest using SSL

    Is the certificate that the server issues valid itself? Also, if you're willing to ignore such certificate issue errors, then implement an ICertificatePolicy class which returns true for every check of validation results.

  3. #3

    Thread Starter
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Re: FTPWebRequest using SSL

    Well, I'm informed that it is valid but I have idea how I would check it.

    Anyway, I think I've done something similar by implementing the following:
    Code:
        Private Function CertificateAuthenticate( _
                ByVal sender As Object, _
                ByVal certificate As X509Certificate, _
                ByVal chain As X509Chain, _
                ByVal sslPolicyErrors As SslPolicyErrors _
        ) As Boolean
    
            Return True
    
        End Function
    
        Public Sub New()
            ServicePointManager.ServerCertificateValidationCallback = New System.Net.Security.RemoteCertificateValidationCallback(AddressOf CertificateAuthenticate)
        End Sub
    I must say that it seems like a rather convoluted way of doing things. Why I couldn't just turn off certificate checking on the FTPWebRequest object I don't know...
    Everything I say is either loose interpretation of dubious facts or idle speculation rooted in irrational sentiment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width