Can't establish TLS connection
I am able to login to FTP site with importing the client certificate.But when i try to run via batch script i am getting an error.
Below is the log
. 2016-03-29 06:26:19.930 WinSCP Version 5.8.1 beta (Build 6144) (OS 6.1.7601 Service Pack 1 - Windows Server 2008 R2 Enterprise)
. 2016-03-29 06:26:19.930 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2016-03-29 06:26:19.930 Log level: Normal
. 2016-03-29 06:26:19.930 Local account: XXXXXXX
. 2016-03-29 06:26:19.930 Working directory: U:\
. 2016-03-29 06:26:19.930 Process ID: 4692
. 2016-03-29 06:26:19.930 Command-line: "C:\Program Files\WinSCP\WinSCP.exe" /console=581 /consoleinstance=_4736_67 "/script=D:\FTP\LPDTR030_WELLSFARGO_sftp_script.txt" "/log=D:\Autosys\LOGS\LPDTR030.JS000010_SFtp_log.txt"
. 2016-03-29 06:26:19.930 Time zone: Current: GMT-4, Standard: GMT-5 (Eastern Standard Time), DST: GMT-4 (Eastern Daylight Time), DST Start: 03/13/2016, DST End: 11/06/2016
. 2016-03-29 06:26:19.930 Login time: Tuesday, March 29, 2016 6:26:19 AM
. 2016-03-29 06:26:19.930 --------------------------------------------------------------------------
. 2016-03-29 06:26:19.930 Script: Retrospectively logging previous script records:
> 2016-03-29 06:26:19.930 Script: option echo off
< 2016-03-29 06:26:19.930 Script: echo off
> 2016-03-29 06:26:19.930 Script: option batch on
< 2016-03-29 06:26:19.930 Script: batch on
< 2016-03-29 06:26:19.930 Script: reconnecttime 120
> 2016-03-29 06:26:19.930 Script: option confirm off
< 2016-03-29 06:26:19.930 Script: confirm off
> 2016-03-29 06:26:19.930 Script: open ftp://xxxxxx:***@xxxxxxxxxxxxxxx.com/ -explicittls -certificate="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
. 2016-03-29 06:26:19.930 --------------------------------------------------------------------------
. 2016-03-29 06:26:19.930 Session name: xxxxxx@xxxxxxxxxxxxxxx.com (Ad-Hoc site)
. 2016-03-29 06:26:19.930 Host name: xxxxxxxxxxxxxxx.com (Port: 21)
. 2016-03-29 06:26:19.930 User name: xxxxxx (Password: Yes, Key file: No)
. 2016-03-29 06:26:19.930 Transfer Protocol: FTP
. 2016-03-29 06:26:19.930 Ping type: Dummy, Ping interval: 30 sec; Timeout: 15 sec
. 2016-03-29 06:26:19.930 Disable Nagle: No
. 2016-03-29 06:26:19.930 Proxy: None
. 2016-03-29 06:26:19.930 Send buffer: 262144
. 2016-03-29 06:26:19.930 UTF: Auto
. 2016-03-29 06:26:19.930 FTP: FTPS: Explicit TLS/SSL [Client certificate: No]; Passive: Yes [Force IP: Auto]; MLSD: Auto [List all: Auto]
. 2016-03-29 06:26:19.930 Session reuse: Yes
. 2016-03-29 06:26:19.930 TLS/SSL versions: TLSv1.0-TLSv1.2
. 2016-03-29 06:26:19.930 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2016-03-29 06:26:19.930 Cache directory changes: Yes, Permanent: Yes
. 2016-03-29 06:26:19.930 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2016-03-29 06:26:19.930 Timezone offset: 0h 0m
. 2016-03-29 06:26:19.930 --------------------------------------------------------------------------
. 2016-03-29 06:26:19.930 Connecting to xxxxxxxxxxxxxxx.com ...
. 2016-03-29 06:26:20.039 Connected with xxxxxxxxxxxxxxx.com, negotiating TLS connection...
< 2016-03-29 06:26:20.070 220 Welcome to Axway Gateway FTP server
> 2016-03-29 06:26:20.070 AUTH TLS
< 2016-03-29 06:26:20.101 234 Security data exchange complete.
. 2016-03-29 06:26:20.476 Server asks for authentication with a client certificate.
. 2016-03-29 06:26:20.507 SSL3 alert read: fatal: bad certificate
. 2016-03-29 06:26:20.507 TLS connect: failed in SSLv3 read finished A
. 2016-03-29 06:26:20.507 Can't establish TLS connection
. 2016-03-29 06:26:20.507 Disconnected from server
. 2016-03-29 06:26:20.507 Connection failed.
. 2016-03-29 07:09:47.505 --------------------------------------------------------------------------
. 2016-03-29 07:09:47.505 WinSCP Version 5.8.1 beta (Build 6144) (OS 6.1.7601 Service Pack 1 - Windows Server 2008 R2 Enterprise)
. 2016-03-29 07:09:47.505 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2016-03-29 07:09:47.505 Log level: Normal
. 2016-03-29 07:09:47.505 Local account: xxxxxxxx
. 2016-03-29 07:09:47.505 Working directory: U:\
. 2016-03-29 07:09:47.505 Process ID: 2224
. 2016-03-29 07:09:47.521 Command-line: "C:\Program Files\WinSCP\WinSCP.exe" /console=581 /consoleinstance=_4060_301 "/script=D:\FTP\LPDTR030_WELLSFARGO_sftp_script.txt" "/log=D:\Autosys\LOGS\LPDTR030.JS000010_SFtp_log.txt"
. 2016-03-29 07:09:47.521 Time zone: Current: GMT-4, Standard: GMT-5 (Eastern Standard Time), DST: GMT-4 (Eastern Daylight Time), DST Start: 03/13/2016, DST End: 11/06/2016
. 2016-03-29 07:09:47.521 Login time: Tuesday, March 29, 2016 7:09:47 AM
. 2016-03-29 07:09:47.521 --------------------------------------------------------------------------
. 2016-03-29 07:09:47.521 Script: Retrospectively logging previous script records:
> 2016-03-29 07:09:47.521 Script: option echo off
< 2016-03-29 07:09:47.521 Script: echo off
> 2016-03-29 07:09:47.521 Script: option batch on
< 2016-03-29 07:09:47.521 Script: batch on
< 2016-03-29 07:09:47.521 Script: reconnecttime 120
> 2016-03-29 07:09:47.521 Script: option confirm off
< 2016-03-29 07:09:47.521 Script: confirm off
> 2016-03-29 07:09:47.521 Script: open ftp://xxxxxx:***@xxxxxxxxxxxxxxx.com/ -explicittls -certificate="xxxxxx"
. 2016-03-29 07:09:47.521 --------------------------------------------------------------------------
. 2016-03-29 07:09:47.521 Session name: xxxxxx@xxxxxxxxxxxxxxx.com (Ad-Hoc site)
. 2016-03-29 07:09:47.521 Host name: xxxxxxxxxxxxxxx.com (Port: 21)
. 2016-03-29 07:09:47.521 User name: xxxxxx (Password: Yes, Key file: No)
. 2016-03-29 07:09:47.521 Transfer Protocol: FTP
. 2016-03-29 07:09:47.521 Ping type: Dummy, Ping interval: 30 sec; Timeout: 15 sec
. 2016-03-29 07:09:47.521 Disable Nagle: No
. 2016-03-29 07:09:47.521 Proxy: None
. 2016-03-29 07:09:47.521 Send buffer: 262144
. 2016-03-29 07:09:47.521 UTF: Auto
. 2016-03-29 07:09:47.521 FTP: FTPS: Explicit TLS/SSL [Client certificate: No]; Passive: Yes [Force IP: Auto]; MLSD: Auto [List all: Auto]
. 2016-03-29 07:09:47.521 Session reuse: Yes
. 2016-03-29 07:09:47.521 TLS/SSL versions: TLSv1.0-TLSv1.2
. 2016-03-29 07:09:47.521 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2016-03-29 07:09:47.521 Cache directory changes: Yes, Permanent: Yes
. 2016-03-29 07:09:47.521 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2016-03-29 07:09:47.521 Timezone offset: 0h 0m
. 2016-03-29 07:09:47.521 --------------------------------------------------------------------------
. 2016-03-29 07:09:47.521 Connecting to xxxxxxxxxxxxxxx.com ...
. 2016-03-29 07:09:47.646 Connected with xxxxxxxxxxxxxxx.com, negotiating TLS connection...
< 2016-03-29 07:09:47.677 220 Welcome to Axway Gateway FTP server
> 2016-03-29 07:09:47.677 AUTH TLS
< 2016-03-29 07:09:47.724 234 Security data exchange complete.
. 2016-03-29 07:09:48.020 Server asks for authentication with a client certificate.
. 2016-03-29 07:09:48.051 SSL3 alert read: fatal: bad certificate
. 2016-03-29 07:09:48.051 TLS connect: failed in SSLv3 read finished A
. 2016-03-29 07:09:48.067 Can't establish TLS connection
. 2016-03-29 07:09:48.067 Disconnected from server
. 2016-03-29 07:09:48.067 Connection failed.
Below is the log
. 2016-03-29 06:26:19.930 WinSCP Version 5.8.1 beta (Build 6144) (OS 6.1.7601 Service Pack 1 - Windows Server 2008 R2 Enterprise)
. 2016-03-29 06:26:19.930 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2016-03-29 06:26:19.930 Log level: Normal
. 2016-03-29 06:26:19.930 Local account: XXXXXXX
. 2016-03-29 06:26:19.930 Working directory: U:\
. 2016-03-29 06:26:19.930 Process ID: 4692
. 2016-03-29 06:26:19.930 Command-line: "C:\Program Files\WinSCP\WinSCP.exe" /console=581 /consoleinstance=_4736_67 "/script=D:\FTP\LPDTR030_WELLSFARGO_sftp_script.txt" "/log=D:\Autosys\LOGS\LPDTR030.JS000010_SFtp_log.txt"
. 2016-03-29 06:26:19.930 Time zone: Current: GMT-4, Standard: GMT-5 (Eastern Standard Time), DST: GMT-4 (Eastern Daylight Time), DST Start: 03/13/2016, DST End: 11/06/2016
. 2016-03-29 06:26:19.930 Login time: Tuesday, March 29, 2016 6:26:19 AM
. 2016-03-29 06:26:19.930 --------------------------------------------------------------------------
. 2016-03-29 06:26:19.930 Script: Retrospectively logging previous script records:
> 2016-03-29 06:26:19.930 Script: option echo off
< 2016-03-29 06:26:19.930 Script: echo off
> 2016-03-29 06:26:19.930 Script: option batch on
< 2016-03-29 06:26:19.930 Script: batch on
< 2016-03-29 06:26:19.930 Script: reconnecttime 120
> 2016-03-29 06:26:19.930 Script: option confirm off
< 2016-03-29 06:26:19.930 Script: confirm off
> 2016-03-29 06:26:19.930 Script: open ftp://xxxxxx:***@xxxxxxxxxxxxxxx.com/ -explicittls -certificate="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
. 2016-03-29 06:26:19.930 --------------------------------------------------------------------------
. 2016-03-29 06:26:19.930 Session name: xxxxxx@xxxxxxxxxxxxxxx.com (Ad-Hoc site)
. 2016-03-29 06:26:19.930 Host name: xxxxxxxxxxxxxxx.com (Port: 21)
. 2016-03-29 06:26:19.930 User name: xxxxxx (Password: Yes, Key file: No)
. 2016-03-29 06:26:19.930 Transfer Protocol: FTP
. 2016-03-29 06:26:19.930 Ping type: Dummy, Ping interval: 30 sec; Timeout: 15 sec
. 2016-03-29 06:26:19.930 Disable Nagle: No
. 2016-03-29 06:26:19.930 Proxy: None
. 2016-03-29 06:26:19.930 Send buffer: 262144
. 2016-03-29 06:26:19.930 UTF: Auto
. 2016-03-29 06:26:19.930 FTP: FTPS: Explicit TLS/SSL [Client certificate: No]; Passive: Yes [Force IP: Auto]; MLSD: Auto [List all: Auto]
. 2016-03-29 06:26:19.930 Session reuse: Yes
. 2016-03-29 06:26:19.930 TLS/SSL versions: TLSv1.0-TLSv1.2
. 2016-03-29 06:26:19.930 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2016-03-29 06:26:19.930 Cache directory changes: Yes, Permanent: Yes
. 2016-03-29 06:26:19.930 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2016-03-29 06:26:19.930 Timezone offset: 0h 0m
. 2016-03-29 06:26:19.930 --------------------------------------------------------------------------
. 2016-03-29 06:26:19.930 Connecting to xxxxxxxxxxxxxxx.com ...
. 2016-03-29 06:26:20.039 Connected with xxxxxxxxxxxxxxx.com, negotiating TLS connection...
< 2016-03-29 06:26:20.070 220 Welcome to Axway Gateway FTP server
> 2016-03-29 06:26:20.070 AUTH TLS
< 2016-03-29 06:26:20.101 234 Security data exchange complete.
. 2016-03-29 06:26:20.476 Server asks for authentication with a client certificate.
. 2016-03-29 06:26:20.507 SSL3 alert read: fatal: bad certificate
. 2016-03-29 06:26:20.507 TLS connect: failed in SSLv3 read finished A
. 2016-03-29 06:26:20.507 Can't establish TLS connection
. 2016-03-29 06:26:20.507 Disconnected from server
. 2016-03-29 06:26:20.507 Connection failed.
. 2016-03-29 07:09:47.505 --------------------------------------------------------------------------
. 2016-03-29 07:09:47.505 WinSCP Version 5.8.1 beta (Build 6144) (OS 6.1.7601 Service Pack 1 - Windows Server 2008 R2 Enterprise)
. 2016-03-29 07:09:47.505 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
. 2016-03-29 07:09:47.505 Log level: Normal
. 2016-03-29 07:09:47.505 Local account: xxxxxxxx
. 2016-03-29 07:09:47.505 Working directory: U:\
. 2016-03-29 07:09:47.505 Process ID: 2224
. 2016-03-29 07:09:47.521 Command-line: "C:\Program Files\WinSCP\WinSCP.exe" /console=581 /consoleinstance=_4060_301 "/script=D:\FTP\LPDTR030_WELLSFARGO_sftp_script.txt" "/log=D:\Autosys\LOGS\LPDTR030.JS000010_SFtp_log.txt"
. 2016-03-29 07:09:47.521 Time zone: Current: GMT-4, Standard: GMT-5 (Eastern Standard Time), DST: GMT-4 (Eastern Daylight Time), DST Start: 03/13/2016, DST End: 11/06/2016
. 2016-03-29 07:09:47.521 Login time: Tuesday, March 29, 2016 7:09:47 AM
. 2016-03-29 07:09:47.521 --------------------------------------------------------------------------
. 2016-03-29 07:09:47.521 Script: Retrospectively logging previous script records:
> 2016-03-29 07:09:47.521 Script: option echo off
< 2016-03-29 07:09:47.521 Script: echo off
> 2016-03-29 07:09:47.521 Script: option batch on
< 2016-03-29 07:09:47.521 Script: batch on
< 2016-03-29 07:09:47.521 Script: reconnecttime 120
> 2016-03-29 07:09:47.521 Script: option confirm off
< 2016-03-29 07:09:47.521 Script: confirm off
> 2016-03-29 07:09:47.521 Script: open ftp://xxxxxx:***@xxxxxxxxxxxxxxx.com/ -explicittls -certificate="xxxxxx"
. 2016-03-29 07:09:47.521 --------------------------------------------------------------------------
. 2016-03-29 07:09:47.521 Session name: xxxxxx@xxxxxxxxxxxxxxx.com (Ad-Hoc site)
. 2016-03-29 07:09:47.521 Host name: xxxxxxxxxxxxxxx.com (Port: 21)
. 2016-03-29 07:09:47.521 User name: xxxxxx (Password: Yes, Key file: No)
. 2016-03-29 07:09:47.521 Transfer Protocol: FTP
. 2016-03-29 07:09:47.521 Ping type: Dummy, Ping interval: 30 sec; Timeout: 15 sec
. 2016-03-29 07:09:47.521 Disable Nagle: No
. 2016-03-29 07:09:47.521 Proxy: None
. 2016-03-29 07:09:47.521 Send buffer: 262144
. 2016-03-29 07:09:47.521 UTF: Auto
. 2016-03-29 07:09:47.521 FTP: FTPS: Explicit TLS/SSL [Client certificate: No]; Passive: Yes [Force IP: Auto]; MLSD: Auto [List all: Auto]
. 2016-03-29 07:09:47.521 Session reuse: Yes
. 2016-03-29 07:09:47.521 TLS/SSL versions: TLSv1.0-TLSv1.2
. 2016-03-29 07:09:47.521 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2016-03-29 07:09:47.521 Cache directory changes: Yes, Permanent: Yes
. 2016-03-29 07:09:47.521 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2016-03-29 07:09:47.521 Timezone offset: 0h 0m
. 2016-03-29 07:09:47.521 --------------------------------------------------------------------------
. 2016-03-29 07:09:47.521 Connecting to xxxxxxxxxxxxxxx.com ...
. 2016-03-29 07:09:47.646 Connected with xxxxxxxxxxxxxxx.com, negotiating TLS connection...
< 2016-03-29 07:09:47.677 220 Welcome to Axway Gateway FTP server
> 2016-03-29 07:09:47.677 AUTH TLS
< 2016-03-29 07:09:47.724 234 Security data exchange complete.
. 2016-03-29 07:09:48.020 Server asks for authentication with a client certificate.
. 2016-03-29 07:09:48.051 SSL3 alert read: fatal: bad certificate
. 2016-03-29 07:09:48.051 TLS connect: failed in SSLv3 read finished A
. 2016-03-29 07:09:48.067 Can't establish TLS connection
. 2016-03-29 07:09:48.067 Disconnected from server
. 2016-03-29 07:09:48.067 Connection failed.