Topic "Certificate Thumbprint Regex validation problem - LEFT to right mark"

Author Message


I had some problems with a WinScp PowerShell script that was attempting to validate the 'TLSHostCertificateFingerprint' property. It seems that most certificates include a hidden Left to right mark (Unicode 200E) at the beginning of their thumbprint properties. This hidden character is included when I copy and paste the thumbprint from a Windows Certificate properties dialog into a Powershell script. Unfortunately, the Regex that WinSCP uses to validate the thumbprint does not handle this hidden character being present. I get an exception
Exception setting "TlsHostCertificateFingerprint": "TLS host certificate fingerprint "‎a9 3b 86 6d a1 d4 ec f0 f3 c4 1e 15 f0 65 c7 d7 04 2d 26 af" does not match pattern

If I remove the hidden character at the beginning of the thumbprint (or manually type it), then the validation works. At very least I think this issue warrants an improvement in the error message, preferably it should include an optional left to right mark in the Regex so that copied and pasted thumbprints work.

I have reproduced this problem in WinSCP 5.9.3 and WinSCP 5.7.7 on Windows 8.1 and Server 2012 R2.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
Thanks for your feedback.

What improvement to the error message would you suggest?

You can post new topics in this forum


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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License