UNABLE to send an SSL/HTTPS request
Closed this issue · 2 comments
hxm-cpp commented
on this example :
#include "libressl/include/tls.h"
#define BUF_SIZ 4096
int
main (void)
{
char request[BUF_SIZ] = "GET / HTTP/1.1\r\nHost: google.com\r\nConnection: Close\r\n\r\n";
struct tls_config *config;
struct tls *ctx;
config = tls_config_new();
//tls_config_insecure_noverifycert(config);
//tls_config_insecure_noverifyname(config);
//tls_config_insecure_noverifytime(config);
ctx = tls_client();
tls_configure(ctx, config);
tls_connect(ctx, "google.com", "443");
// Writes to the encrypted socket aka send the request
tls_write(ctx, request, BUF_SIZ);
// Cleanup
tls_close(ctx);
tls_free(ctx);
return 0;
}
what should i configure to be able to receive the req ?