Topic "WebDAV with untrusted SSL cert from .Net"

Author Message
semery
[View user's profile]

Joined: 2015-02-25
Posts: 2
WinSCP version: 5.7 (https://winscp.net/download/winscp570automation.zip)

I am trying to connect to a WebDAV server with a self-signed certificate using the .Net assembly. I can connect to the same server with the WebDAV protocol on a different port (and with the WinSCP GUI) without SSL but I can't figure out the correct options to set to get SSL working.

If I don't supply the server's host certificate fingerprint, I get the error (as expected):
Code:
WinSCP.SessionRemoteException: Server certificate verification failed: certificate issued for a different hostname, issuer is not trusted ---> WinSCP.SessionRemoteException: Connection failed.

If I supply the certificate fingerprint with SessionOptions.TlsHostCertificateFingerprint, I get the error:
Code:
System.ArgumentException: SessionOptions.TlsHostCertificateFingerprint or SessionOptions.GiveUpSecurityAndAcceptAnyTlsHostCertificate is set, but SessionOptions.FtpSecure is FtpSecure.None.

So then if I set SessionOptions.FtpSecure to FtpSecure.Implicit, I get the error:
Code:
System.ArgumentException: SessionOptions.FtpSecure is not FtpSecure.None, but SessionOptions.Protocol is not Protocol.Ftp.

Is there anything else I can try?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Thanks for your report.

That's a bug, will fix it.

Meanwhile, you can download source code of WinSCP and modify the check in Session.SessionOptionsToOpenSwitches.

Instead of
if (sessionOptions.FtpSecure == FtpSecure.None)
use
if ((sessionOptions.FtpSecure == FtpSecure.None) && !sessionOptions.WebdavSecure)
_________________
Martin Prikryl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
This bug has been added to the tracker:
https://winscp.net/tracker/show_bug.cgi?id=1284

I'm sending you an email with a development version of WinSCP to address you have used to register on this forum.
semery
[View user's profile]

Joined: 2015-02-25
Posts: 2
prikryl wrote:
This bug has been added to the tracker:
https://winscp.net/tracker/show_bug.cgi?id=1284

I'm sending you an email with a development version of WinSCP to address you have used to register on this forum.

Dev version works great! Thanks!
fvboegeld
[View user's profile]

Joined: 2015-01-19
Posts: 2
Hello,

I'm having the same issue with SSL webdav

Can i also give this dev version a try?

Thanks!
Frederik
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
fvboegeld wrote:
I'm having the same issue with SSL webdav

Can i also give this dev version a try?

Sent.
_________________
Martin Prikryl
fvboegeld
[View user's profile]

Joined: 2015-01-19
Posts: 2
Thanks

Its working perfect now!

Frederik
kyle@...

Guest


martin wrote:
Thanks for your report.

That's a bug, will fix it.

Meanwhile, you can download source code of WinSCP and modify the check in Session.SessionOptionsToOpenSwitches.

Instead of
if (sessionOptions.FtpSecure == FtpSecure.None)
use
if ((sessionOptions.FtpSecure == FtpSecure.None) && !sessionOptions.WebdavSecure)


Hi, can I have this version please.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
kyle@... wrote:
Hi, can I have this version please.

Just download the latest version, this has been fixed while ago:
https://winscp.net/tracker/show_bug.cgi?id=1284
Peterpan

Guest


martin wrote:
kyle@... wrote:
Hi, can I have this version please.

Just download the latest version, this has been fixed while ago:
https://winscp.net/tracker/show_bug.cgi?id=1284


I can't find the latest version to download. I went to download link (https://winscp.net/eng/download.php#download2), but that is the version modified on 6/3/2016, which is before the fixed one.
Please help.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Peterpan wrote:
I can't find the latest version to download. I went to download link (https://winscp.net/eng/download.php#download2), but that is the version modified on 6/3/2016, which is before the fixed one.
Please help.

No idea what you mean. The bug was fixed in 5.7.1, which was released on 2015-03-25 (over a year ago). The current stable version is 5.7.7, released on 2016-03-06.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License