Sample code for 30+ languages & platforms
AutoIt

FTPS with Mutual TLS Authentication (TLS Client Certificate)

See more FTP Examples

Demonstrates how to do mutual TLS authentication (using a client certificate from a .pfx/.p12).

Chilkat AutoIt Downloads

AutoIt
Local $bSuccess = False

; This example requires the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.

$oFtp = ObjCreate("Chilkat.Ftp2")

$oFtp.Hostname = "ftp.example.com"
$oFtp.Port = 21

; If using implicit TLS, you probably want port 990..
$oFtp.Port = 990

; Set this to False for implicit TLS, otherwise set to True for explicit TLS (where port is typically 21).
$oFtp.AuthTls = False

; Set this to True for implicit TLS, otherwise set to False.
$oFtp.Ssl = True

$oCert = ObjCreate("Chilkat.Cert")
$bSuccess = $oCert.LoadPfxFile("qa_data/pfx/example.pfx","pfx_password")
If ($bSuccess = False) Then
    ConsoleWrite($oCert.LastErrorText & @CRLF)
    Exit
EndIf

; Use this certificate for our TLS mutually authenticated connection:
$bSuccess = $oFtp.SetSslClientCert($oCert)
If ($bSuccess = False) Then
    ConsoleWrite($oCert.LastErrorText & @CRLF)
    Exit
EndIf

; Establish the TLS connection with the FTP server.
$bSuccess = $oFtp.ConnectOnly()
If ($bSuccess = False) Then
    ConsoleWrite($oFtp.LastErrorText & @CRLF)
    Exit
EndIf

; If a login is required, then login with the FTP account login/password.
$oFtp.Username = "myLogin"
$oFtp.Password = "myPassword"
$bSuccess = $oFtp.LoginAfterConnectOnly()
If ($bSuccess = False) Then
    ConsoleWrite($oFtp.LastErrorText & @CRLF)
    Exit
EndIf

; Do whatever you're doing to do ...
; upload files, download files, etc...

; .....
; .....

$bSuccess = $oFtp.Disconnect()