Skip to content

libcURL.EasyHandle.ConnectionType

Andrew Lambert edited this page Jan 7, 2023 · 22 revisions

libcURL.EasyHandle.ConnectionType

Property Declaration

 Dim ConnectionType As libcURL.ConnectionType

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 a member of the libcURL.ConnectionType enum.

ConnectionType Comment
NoSSL Let libcURL decide (default)
AttemptSSL Attempt using SSL, proceed without it if unavailable
SSLControlConnectionOnly Force FTP control connections to use SSL
SSLForceAll 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 use SSL for all connections:

 Dim curl As New libcURL.EasyHandle
 curl.ConnectionType = libcURL.ConnectionType.SSLForceAll

See also

Clone this wiki locally