Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.5   8.0   8.1   8.2   8.3   8.4   8.5   9.0   9.1   9.2    Statistic  


Sets the SSL authentication types.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
CURL 2.5 Yes Yes Yes Yes Yes
MBS( "CURL.SetOptionSSHAuthTypes"; curl; Value )   More


Parameter Description Example value
curl The CURL session handle. $curl
Value The new types. 3


Returns "OK" on success.


Sets the SSL authentication types.
Pass a number set to a bitmask consisting of one or more of CURLSSH_AUTH_PUBLICKEY, CURLSSH_AUTH_PASSWORD, CURLSSH_AUTH_HOST, CURLSSH_AUTH_KEYBOARD. Set CURLSSH_AUTH_ANY to let libcurl pick one.

CURLSSH_AUTH_ANY-1all types supported by the server.
CURLSSH_AUTH_NONE0none allowed, silly but complete.
CURLSSH_AUTH_PUBLICKEY1public/private key files.
CURLSSH_AUTH_HOST4host key files.
CURLSSH_AUTH_KEYBOARD8keyboard interactive.

See also SSH_AUTH_TYPES option in CURL manual.


Use password, no private key:

MBS( "CURL.SetOptionSSHAuthTypes"; $curl; 2+8 )

Download file via SFTP to file on disk:

Set Variable [$curl; Value:MBS("CURL.New") ]
# set download URL, e.g. s
Set Variable [$result; Value:MBS("CURL.SetOptionURL"; $curl; SFTP Download::URL )]
# build file path on disk and open output file
Set Variable [$name; Value:GetValue(SFTP Download::FileName; 1)]
Set Variable [$path; Value:MBS( "Path.AddPathComponent"; SFTP Download::FolderPath; $name )]
Set Variable [$r; Value:MBS("CURL.CreateOutputFile"; $curl; $path)]
# login only via password
Set Variable [$result; Value:MBS( "CURL.SetOptionSSHAuthTypes"; $curl; 2+8 )]
# set credentials
Set Variable [$result; Value:MBS("CURL.SetOptionUsername"; $curl; SFTP Download::UserName )]
Set Variable [$result; Value:MBS("CURL.SetOptionPassword"; $curl; SFTP Download::Password )]
# run transfer
Set Field [SFTP Download::ErrorCode; MBS("CURL.Perform"; $curl)]
# check debug log for errors
Set Field [SFTP Download::Debug; MBS("CURL.GetDebugAsText"; $curl)]
# free CURL session
Set Variable [$result; Value:MBS("CURL.Cleanup"; $curl)]

See also

Created 18th August 2014, last changed 21st April 2017

CURL.SetOptionSASLIR   -   CURL.SetOptionSSHCompression

Feedback: Report problem or ask question.

MBS Xojo Plugins