Command line upload gives certificate error

Advertisement

gwatchma
Donor
Joined:
Posts:
5
Location:
milwaukee

Command line upload gives certificate error

Dear All,

I have a script to upload a file, but I get a certificate error. The certificate is a self-signed one I created on the server and also loaded into the local machine. The command line I execute is:
execute ("C:\\Program Files\\WinSCP\\WinSCP.exe /log=s:\\ohowcheckin\\winscplogs\\WinSCP.log /ini=nul /script=s:\\ohowcheckin\\winscpscripts\\script.txt",true)
The script file contains:
open ftp://gwatchm:password@www.medreg.com:990/ -implicit -certificate="ssh-rsa 2048 4d:f3:8a:8c:cb:4e:55:a9:8f:ad:12:b7:e9:e9:3d:0e:0f:60:4b:ef"
lcd s:\ohowcheckin\data
put WINscptestfile.txt
exit
And the resultant log file has this:
. 2018-01-25 20:29:53.378 Session name: gwatchm@www.medreg.com (Ad-Hoc site)
. 2018-01-25 20:29:53.378 Host name: www.medreg.com (Port: 990)
. 2018-01-25 20:29:53.378 User name: gwatchm (Password: Yes, Key file: No, Passphrase: No)
. 2018-01-25 20:29:53.378 Transfer Protocol: FTP
. 2018-01-25 20:29:53.378 Ping type: Dummy, Ping interval: 30 sec; Timeout: 15 sec
. 2018-01-25 20:29:53.383 Disable Nagle: No
. 2018-01-25 20:29:53.383 Proxy: None
. 2018-01-25 20:29:53.383 Send buffer: 262144
. 2018-01-25 20:29:53.383 UTF: Auto
. 2018-01-25 20:29:53.383 FTPS: Implicit TLS/SSL [Client certificate: No]
. 2018-01-25 20:29:53.383 FTP: Passive: Yes [Force IP: Auto]; MLSD: Auto [List all: Auto]; HOST: Auto
. 2018-01-25 20:29:53.388 Session reuse: Yes
. 2018-01-25 20:29:53.388 TLS/SSL versions: TLSv1.0-TLSv1.2
. 2018-01-25 20:29:53.388 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2018-01-25 20:29:53.388 Cache directory changes: Yes, Permanent: Yes
. 2018-01-25 20:29:53.388 Recycle bin: Delete to: No, Overwritten to: No, Bin path: 
. 2018-01-25 20:29:53.388 Timezone offset: 0h 0m
. 2018-01-25 20:29:53.393 --------------------------------------------------------------------------. 2018-01-25 20:29:53.628 Connecting to www.medreg.com:990 ...
. 2018-01-25 20:29:53.738 Connected with www.medreg.com:990, negotiating TLS connection...
. 2018-01-25 20:29:53.908 Verifying certificate for "" with fingerprint 4c:f3:35:8c:cb:4e:5a:a9:9f:ad:12:b7:e9:e9:3d:0e:0f:60:4b:ef and 20 failures
. 2018-01-25 20:29:53.908 Asking user:
. 2018-01-25 20:29:53.908 **The server's certificate is not known. You have no guarantee that the server is the computer you think it is.**
. 2018-01-25 20:29:53.908 
. 2018-01-25 20:29:53.908 Server's certificate details follow:
. 2018-01-25 20:29:53.913 
. 2018-01-25 20:29:53.913 Issuer:
. 2018-01-25 20:29:53.913 - Organization: MedReg
. 2018-01-25 20:29:53.913 
. 2018-01-25 20:29:53.913 Subject:
. 2018-01-25 20:29:53.913 - Organization: MedReg
. 2018-01-25 20:29:53.918 
. 2018-01-25 20:29:53.918 Valid: 1/25/2018 2:02:20 AM - 1/24/2019 12:00:00 AM
. 2018-01-25 20:29:53.918 
. 2018-01-25 20:29:53.918 Fingerprint (SHA-1): 4b:f3:83:8c:cb:4e:55:89:9f:ad:12:b7:e9:e9:3d:0e:0f:60:4b:ef
. 2018-01-25 20:29:53.918 
. 2018-01-25 20:29:53.918 Summary: Unable to get local issuer certificate. The error occurred at a depth of 1 in the certificate chain.
. 2018-01-25 20:29:53.923 
. 2018-01-25 20:29:53.923 Certificate was not issued for this server. You might be connecting to a server that is pretending to be "www.medreg.com".
. 2018-01-25 20:29:53.923 
. 2018-01-25 20:29:53.923 If you trust this certificate, press Yes. To connect without storing certificate, press No. To abandon the connection press Cancel.
. 2018-01-25 20:29:53.923 
. 2018-01-25 20:29:53.923 Continue connecting and store the certificate? ()
. 2018-01-25 20:30:03.924 Peer certificate rejected
. 2018-01-25 20:30:03.924 Disconnected from server
. 2018-01-25 20:30:03.924 Connection failed.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,468
Location:
Prague, Czechia

Re: Command line upload gives certificate error

Remove the ssh-rsa 2048 part from the -certificate switch.
(You are connecting with FTPS. It has nothing to do with SSH)

Reply with quote

Advertisement

You can post new topics in this forum