reqFTP.EnableSsl = true;<p><span style="font-size:9.5pt;color:black">Hi,</span></p> <p><span style="font-size:9.5pt;color:black">I'm using a hosting company that offers FTPS, but because the certificate is self signed it's coming up with an error.</span></p> <p><span style="font-size:9.5pt;color:black">Is it possible to bypass the certificate error (exception) and still login? I notice that with other FTP programs (FileZilla), you can choose to trust the certificate if it doesn't pass inspection.</span></p> <p><span style="font-size:9.5pt;color:black"></span> </p> <p><span style="font-size:9.5pt;color:black">thanks,</span></p> <p><span style="font-size:9.5pt;color:black">Ron</span></p> <p></span></p>© 2009 Microsoft Corporation. All rights reserved.Thu, 19 Jun 2008 00:15:52 Z8bfdaea0-b4ec-4aa1-96c1-c3f0dd0b0031http://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/8bfdaea0-b4ec-4aa1-96c1-c3f0dd0b0031#8bfdaea0-b4ec-4aa1-96c1-c3f0dd0b0031http://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/8bfdaea0-b4ec-4aa1-96c1-c3f0dd0b0031#8bfdaea0-b4ec-4aa1-96c1-c3f0dd0b0031myNameIsRonhttp://social.msdn.microsoft.com/Profile/en-US/?user=myNameIsRonreqFTP.EnableSsl = true;<p><span style="font-size:9.5pt;color:black">Hi,</span></p> <p><span style="font-size:9.5pt;color:black">I'm using a hosting company that offers FTPS, but because the certificate is self signed it's coming up with an error.</span></p> <p><span style="font-size:9.5pt;color:black">Is it possible to bypass the certificate error (exception) and still login? I notice that with other FTP programs (FileZilla), you can choose to trust the certificate if it doesn't pass inspection.</span></p> <p><span style="font-size:9.5pt;color:black"></span> </p> <p><span style="font-size:9.5pt;color:black">thanks,</span></p> <p><span style="font-size:9.5pt;color:black">Ron</span></p> <p></span></p>Sat, 02 Jun 2007 18:03:09 Z2007-06-05T19:24:00Zhttp://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/8bfdaea0-b4ec-4aa1-96c1-c3f0dd0b0031#c860bd44-93f6-4b20-82b4-aac7160edce1http://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/8bfdaea0-b4ec-4aa1-96c1-c3f0dd0b0031#c860bd44-93f6-4b20-82b4-aac7160edce1timvwhttp://social.msdn.microsoft.com/Profile/en-US/?user=timvwreqFTP.EnableSsl = true;And which library are you using? <br><br>(If installing your certificate as a trusted one isn't an option, for .Net libs you would use the  ServicePointManager.ServerCertificateValidationCallback to plugin your own validator...)<br>Sun, 03 Jun 2007 21:40:18 Z2007-06-05T19:24:00Zhttp://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/8bfdaea0-b4ec-4aa1-96c1-c3f0dd0b0031#16314f2f-fee8-44ca-9223-50c418f0def4http://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/8bfdaea0-b4ec-4aa1-96c1-c3f0dd0b0031#16314f2f-fee8-44ca-9223-50c418f0def4myNameIsRonhttp://social.msdn.microsoft.com/Profile/en-US/?user=myNameIsRonreqFTP.EnableSsl = true;<p> </p> <p>Hi timvw,</p> <p>Ops, yes that would have been a good thing to include <img height=19 alt=Surprise src="http://forums.microsoft.com/MSDN/emoticons/emotion-3.gif" width=19>)</p> <p>The certificate error is &quot;Self Signed Certificate&quot;. I'm just trying to use FTP over SSL to protect my FTP login ID and Password.</p> <p> </p> <p>I'm using <font color="#2b91af" size=3>FtpWebRequest</font></p> <p><font color="#2b91af" size=3><font color="#000000">I kept looking, and as you said... <font size=2>ServicePointManager,</font> I did find this code on the web... and it does seem to work.</font></font></p> <p>Is this the best way to go about it?</p> <p>----------------------------------------------------------------------------------------------------------------------------</p><font color="#2b91af" size=3> <p>ServicePointManager</font><font size=3>.ServerCertificateValidationCallback = AcceptAllCertificatePolicy;</p></font> <p><font color="#2b91af" size=3> </p><font color="#008000" size=3> <p>//Code to Accept All Certificates </p> <p></font><font size=3></font><font color="#0000ff" size=3>public</font><font size=3> </font><font color="#0000ff" size=3>static</font><font size=3> </font><font color="#0000ff" size=3>bool</font><font size=3> AcceptAllCertificatePolicy(</font><font color="#0000ff" size=3>object</font><font size=3> sender, </font><font color="#2b91af" size=3>X509Certificate</font><font size=3> certificate, </font><font color="#2b91af" size=3>X509Chain</font><font size=3> chain, </font><font color="#2b91af" size=3>SslPolicyErrors</font><font size=3> sslPolicyErrors)</p> <p>{ </p> <p></font><font color="#0000ff" size=3>return</font><font size=3> </font><font color="#0000ff" size=3>true</font><font size=3>;</p> <p>}</p> <p> </p> <p>Thanks,</p> <p>Ron</p></font></font>Sun, 03 Jun 2007 22:29:26 Z2007-06-05T19:23:56Zhttp://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/8bfdaea0-b4ec-4aa1-96c1-c3f0dd0b0031#22edef85-c5a4-4abd-903a-93fe800261eehttp://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/8bfdaea0-b4ec-4aa1-96c1-c3f0dd0b0031#22edef85-c5a4-4abd-903a-93fe800261eetimvwhttp://social.msdn.microsoft.com/Profile/en-US/?user=timvwreqFTP.EnableSsl = true;As long as you're not doing anything else your code would be enough... But I would probably only return true if the certificate is your own self-signed certificate and in all other cases rely on default validation...Mon, 04 Jun 2007 05:26:30 Z2007-06-05T19:23:41Zhttp://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/8bfdaea0-b4ec-4aa1-96c1-c3f0dd0b0031#3da5d1b7-84ae-4aad-b56b-c844c7924d8bhttp://social.msdn.microsoft.com/Forums/en-US/netfxnetcom/thread/8bfdaea0-b4ec-4aa1-96c1-c3f0dd0b0031#3da5d1b7-84ae-4aad-b56b-c844c7924d8bjust.a.nerdhttp://social.msdn.microsoft.com/Profile/en-US/?user=just.a.nerdreqFTP.EnableSsl = true;<div class=quote> <table width="85%"> <tbody> <tr> <td class=txt4> <strong>myNameIsRon wrote:</strong></td></tr> <tr> <td class=quoteTable> <table width="100%"> <tbody> <tr> <td class=txt4 valign=top width="100%"> <p> </p> <p>I'm just trying to use FTP over SSL to protect my FTP login ID and Password.</p> <p><font color="#2b91af" size=3><font size=3> </p> <p></font></font></p></td></tr></tbody></table></td></tr></tbody></table></div> <p></p> <p align=left> </p> <p align=left>I wish, more people would do just that.</p> <p align=left>And, in that case a self-signed certificate is just as good as one, that makes rich people richer !</p>Fri, 03 Aug 2007 01:19:28 Z2007-08-03T01:19:28Z