mirror of
https://github.com/ading2210/libcurl.js.git
synced 2025-05-13 14:30:02 -04:00
don't include certs in wasm
This commit is contained in:
parent
2e6fba2c3b
commit
2f3ea36ab4
3 changed files with 1 additions and 13 deletions
|
@ -11,7 +11,6 @@ request_cleanup
|
|||
create_request
|
||||
request_set_proxy
|
||||
get_version
|
||||
get_cacert
|
||||
get_error_str
|
||||
|
||||
http_set_options
|
||||
|
|
|
@ -65,7 +65,7 @@ function get_version() {
|
|||
}
|
||||
|
||||
function get_cacert() {
|
||||
return UTF8ToString(_get_cacert());
|
||||
return ":(";
|
||||
}
|
||||
|
||||
function setup_main_session() {
|
||||
|
|
|
@ -7,15 +7,12 @@
|
|||
#include "curl/easy.h"
|
||||
#include "curl/multi.h"
|
||||
|
||||
#include "cacert.h"
|
||||
#include "util.h"
|
||||
#include "types.h"
|
||||
|
||||
void finish_request(CURLMsg *curl_msg);
|
||||
void forward_headers(struct RequestInfo *request_info);
|
||||
|
||||
struct curl_blob cacert_blob;
|
||||
|
||||
size_t write_function(char *data, size_t size, size_t nmemb, struct RequestInfo *request_info) {
|
||||
size_t real_size = size * nmemb;
|
||||
(*request_info->data_callback)(request_info->request_id, data, real_size);
|
||||
|
@ -43,7 +40,6 @@ CURL* create_request(const char* url, int request_id, DataCallback data_callback
|
|||
|
||||
curl_easy_setopt(http_handle, CURLOPT_PRIVATE, request_info);
|
||||
curl_easy_setopt(http_handle, CURLOPT_URL, url);
|
||||
curl_easy_setopt(http_handle, CURLOPT_CAINFO_BLOB , cacert_blob);
|
||||
|
||||
//callbacks to pass the response data back to js
|
||||
curl_easy_setopt(http_handle, CURLOPT_WRITEFUNCTION, &write_function);
|
||||
|
@ -79,13 +75,6 @@ void request_set_proxy(CURL* http_handle, const char* proxy_url) {
|
|||
curl_easy_setopt(http_handle, CURLOPT_PROXY, proxy_url);
|
||||
}
|
||||
|
||||
unsigned char* get_cacert() {
|
||||
return _cacert_pem;
|
||||
}
|
||||
|
||||
void init_curl() {
|
||||
curl_global_init(CURL_GLOBAL_DEFAULT);
|
||||
cacert_blob.data = _cacert_pem;
|
||||
cacert_blob.len = _cacert_pem_len;
|
||||
cacert_blob.flags = CURL_BLOB_NOCOPY;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue