#TLSInitializationFailed when trying to send a GET request to some sites, but it works fine on others

1 messages · Page 1 of 1 (latest)

tawny epoch
#

just as the title says
when I connect to ziglang.org, it works
when i connect to i.e https://torrent.ubuntu.com/announce, it doesn't (i'm implementing a bittorrent client if that's relevant)
here's mode code if needed:

const uri = try std.Uri.parse(URL_HERE);
var client = http.Client{.allocator = allocator};
defer client.deinit();

var headers = http.Headers.init(allocator);
defer headers.deinit();
var request = try client.request(.GET, uri, headers, .{});
defer request.deinit();
try request.start(.{});
try request.wait();
hollow charm
#

the site you are connecting to likely doesnt support TLS1.3

tawny epoch
#

oh

#

so what should I do instead? just use openssl?

#

or I guess just curl at that point

hollow charm
#

if you want yeah that would work

tawny epoch
#

is there any other more ziggy option?

hollow charm
#

theres probably some OpenSSL wrapper laying around on github you can search for

tawny epoch
hollow charm
#

no idea

fresh linden
#

unfortunately not

#

if you want TLS 1.2 you need to either use a proxy or not use std.http

tawny epoch
#

yeah that's annoying but it's alright

#

i guess this is slightly off the topic of zig now, but is there any http C library other than curl either of you could recommend?
personally find libcurl to be pretty painful to use

hollow charm
#

i dont know of any good one i just suffer through curl, but there probably is one somewhere