Libcurl: Difference between revisions
No edit summary |
|||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
This page documents the libcurl package used by official sw. This is statically linked in the main-codebin, on old versions (~v2.x) this was a subsdk NSO. This page does not apply to the libcurl build included in the browser OSS NRO. | This page documents the libcurl package used by official sw. This is statically linked in the main-codebin, on old versions (~v2.x) this was a subsdk NSO. This page does not apply to the libcurl build included in the browser OSS NRO. | ||
Starting with sdkver 10.x, this is built with support for NGHTTP2 with the relevant [[SSL_services|Alpn]] cmds being used for this. | |||
The changes to libcurl compared to the original libcurl are documented below, etc. | The changes to libcurl compared to the original libcurl are documented below, etc. | ||
Line 14: | Line 14: | ||
|- | |- | ||
| [[#URL]] || STRINGPOINT || 2 || 10002 || | | [[#URL]] || STRINGPOINT || 2 || 10002 || | ||
|- | |||
| [[#SSL_CTX_FUNCTION]] || FUNCTIONPOINT || 108 || 20108 || | |||
|- | |- | ||
| [[#PROXYAUTOCONFIG]] || LONG || 500 || 500 || 1 | | [[#PROXYAUTOCONFIG]] || LONG || 500 || 500 || 1 | ||
Line 19: | Line 21: | ||
| [[#UNK501]] || LONG || 501 || 501 || 0 | | [[#UNK501]] || LONG || 501 || 501 || 0 | ||
|- | |- | ||
| || OBJECTPOINT | | [[#UNK502]] || OBJECTPOINT || 502 || 10502 || | ||
|- | |- | ||
| || FUNCTIONPOINT || 503 || || | | [[#UNK503]] || FUNCTIONPOINT || 503 || 20503 || | ||
|- | |- | ||
| || FUNCTIONPOINT || 504 || || | | [[#UNK504]] || FUNCTIONPOINT || 504 || 20504 || | ||
|- | |- | ||
| || OBJECTPOINT | | [[#UNK505]] || OBJECTPOINT || 505 || 10505 || | ||
|- | |- | ||
| [[#UNK506]] || LONG || 506 || 506 || 0 | | [[#UNK506]] || LONG || 506 || 506 || 0 | ||
Line 42: | Line 44: | ||
Afterwards, ResolveEx is used with the first output string from the latter sscanf as the input. Then the final URL is constructed with the output from ResolveEx. | Afterwards, ResolveEx is used with the first output string from the latter sscanf as the input. Then the final URL is constructed with the output from ResolveEx. | ||
== SSL_CTX_FUNCTION == | |||
This funcptr is called with the same params as normal, with the context ptr being {sdknso container object for [[SSL_services#ISslContext|ISslContext]]}. If this funcptr returns non-zero, the CURLcode is set to CURLE_ABORTED_BY_CALLBACK. | |||
This is only used if [[#UNK502]] is not set, in which case an error is thrown if this funcptr is not set. An error is also thrown afterwards if the context wasn't created. | |||
The user must create the [[SSL_services#ISslContext|ISslContext]] using this funcptr, with all required ISslContext initialization - no cmds are used by the caller with ISslContext besides [[SSL_services#CreateConnection|CreateConnection]] (the caller doesn't use [[SSL_services#CreateContext|CreateContext]], the user must). | |||
== PROXYAUTOCONFIG == | == PROXYAUTOCONFIG == | ||
Line 48: | Line 57: | ||
A warning is printed if this option is set when CURLOPT_PROXY is already set - in which case CURLOPT_PROXY is freed. | A warning is printed if this option is set when CURLOPT_PROXY is already set - in which case CURLOPT_PROXY is freed. | ||
This option controls whether to load the system proxy from [[Network_Interface_services#GetCurrentNetworkProfile|nifm]]. The code handling this option was added to the start of the inlined create_conn_helper_init_proxy func. | This option controls whether to load the system proxy from [[Network_Interface_services#GetCurrentNetworkProfile|nifm]]. The code handling this option was added to the start of the inlined create_conn_helper_init_proxy func. The loaded proxy info is written to the CURLOPT PROXY* options as needed. | ||
== UNK501 == | == UNK501 == | ||
Line 54: | Line 63: | ||
This controls the value of the DataCheck [[SSL_services#VerifyOption|VerifyOption]] bit. | This controls the value of the DataCheck [[SSL_services#VerifyOption|VerifyOption]] bit. | ||
== UNK502 == | |||
If set, this is a ptr to a pre-initialized {sdknso container object for [[SSL_services#ISslContext|ISslContext]]}, which is used instead of creating a new one via [[#SSL_CTX_FUNCTION]]. | |||
== UNK503 == | |||
If set, this funcptr is called at the end of [[SSL_services#ISslConnection|ISslConnection]] setup, prior to using [[SSL_services#SetIoMode|SetIoMode]]. If this funcptr returns non-zero, the CURLcode is set to CURLE_ABORTED_BY_CALLBACK. | |||
This funcptr is called with the following params: (Curl_easy*, {sdknso container object for [[SSL_services#ISslConnection|ISslConnection]]}, [[#UNK505]]). | |||
This allows the user to optionally do additional custom [[SSL_services#ISslConnection|ISslConnection]] setup. | |||
== UNK504 == | |||
If set, this funcptr is called following [[SSL_services#DoHandshakeGetServerCert|DoHandshakeGetServerCert]] usage, if it didn't return error 0x1987B. If this funcptr returns non-zero, the CURLcode is set to CURLE_ABORTED_BY_CALLBACK. | |||
This is essentially a custom version of getting the CERTINFO. | |||
This funcptr is called with the following params: (Curl_easy*, {sdknso container object for [[SSL_services#ISslConnection|ISslConnection]]}, [[#UNK505]], {struct ptr}). | |||
Where the struct has the following format: | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset || Size || Description | |||
|- | |||
| 0x0 || 0x1 || bool CURLcode==0 | |||
|- | |||
| 0x1 || 0x7 || Padding | |||
|- | |||
| 0x8 || 0x8 || Output-size from [[SSL_services#DoHandshakeGetServerCert|DoHandshakeGetServerCert]]. | |||
|- | |||
| 0x10 || 0x8 || Total-certs from [[SSL_services#DoHandshakeGetServerCert|DoHandshakeGetServerCert]]. | |||
|} | |||
== UNK505 == | |||
This option value is used as a param for the [[#UNK503]]/[[#UNK504]] funcptrs. | |||
== UNK506 == | == UNK506 == | ||
Line 69: | Line 113: | ||
This is used during Curl_resolver_getaddrinfo. See also [[#URL]]. | This is used during Curl_resolver_getaddrinfo. See also [[#URL]]. | ||
= CURLcode = | |||
This section documents the custom CURLcode values. | |||
{| class="wikitable" border="1" | |||
|- | |||
! Value | |||
! Description | |||
|- | |||
| 95 || {sdknso container object for [[SSL_services#ISslContext|ISslContext]]} isn't initialized. | |||
|- | |||
| 96 || nnsslContextGetContextId failed. | |||
|- | |||
| 98 || Ptr is NULL. | |||
|} |