Skip to content

Commit 9b2470a

Browse files
committed
fix(HttpApiClient): add option to ignore TLS errors
1 parent f8bd770 commit 9b2470a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/systems/network/http_api_client.gd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ class_name HTTPAPIClient
44
@export var base_url := ""
55
@export var headers := PackedStringArray()
66
@export var cache_folder := "HTTPAPIClient"
7+
@export var verify_tls := true
78
var logger := Log.get_logger("HTTPAPIClient")
89

910

@@ -33,6 +34,8 @@ func request(
3334

3435
# Make the request
3536
var http := HTTPRequest.new()
37+
if not verify_tls:
38+
http.set_tls_options(TLSOptions.client_unsafe())
3639
http.timeout = 30.0
3740
add_child.call_deferred(http)
3841
await http.ready
@@ -83,4 +86,3 @@ class Response:
8386
res.header = result[2]
8487
res.body = Marshalls.base64_to_raw(result[3])
8588
return res
86-

0 commit comments

Comments
 (0)