Skip to content

libcURL.EasyHandle.ConnectionType

Andrew Lambert edited this page Sep 17, 2015 · 22 revisions

#libcURL.EasyHandle.ConnectionType

##Property Declaration

 Dim ConnectionType As Integer

##Remarks By default, libcURL will decide when to use SSL based on the URL and other heuristics. Use this property to explicitly request or require upgrading to SSL. This feature is only available when using a protocol that allows upgrading to SSL during an already-established session, e.g. using the STARTTLS command (FTP, SMTP, POP3, IMAP. etc.) Set this to one of the libcURL.Opts.USE_SSL_* constants

Constant Value Comment
USE_SSL_NONE 0 Let libcURL decide (default)
USE_SSL_TRY 1 Attempt using SSL, proceed without it if unavailable
USE_SSL_CONTROL 2 Force FTP control connections to use SSL
USE_SSL_ALL 3 Force all connections to use SSL

This property does not control whether libcURL validates SSL certificates. For that, use EasyHandle.Secure.

Not all supported protocols, notably HTTP, can upgrade existing sessions. For these protocols use the protocol-specific SSL scheme in the URI (i.e. HTTPS instead of HTTP)

If SSL was required but is not available, the transfer will fail with error number CURLE_USE_SSL_FAILED (64).

##Example This example sets the EasyHandle to upgrade to SSL for all connections:

 Dim curl As New libcURL.EasyHandle
 curl.ConnectionType = libcURL.Opts.USE_SSL_ALL

##See also

Clone this wiki locally