mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-06-27 15:43:42 +08:00
Add SM4-FF1, update socket API
This commit is contained in:
@@ -220,7 +220,6 @@ int tls12_client_main(int argc, char *argv[])
|
||||
int verbose = 0;
|
||||
TLS_CTX ctx;
|
||||
TLS_CONNECT conn;
|
||||
struct hostent *hp;
|
||||
struct sockaddr_in server;
|
||||
tls_socket_t sock = tls_socket_invalid();
|
||||
char buf[1024] = {0};
|
||||
@@ -469,15 +468,11 @@ bad:
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!(hp = gethostbyname(host))) {
|
||||
if (tls_socket_get_addr(host, port, &server) != 1) {
|
||||
fprintf(stderr, "%s: failed to parse host name '%s'\n", prog, host);
|
||||
goto end;
|
||||
}
|
||||
|
||||
server.sin_addr = *((struct in_addr *)hp->h_addr_list[0]);
|
||||
server.sin_family = AF_INET;
|
||||
server.sin_port = htons(port);
|
||||
|
||||
if (tls_socket_connect(sock, &server) != 1) {
|
||||
fprintf(stderr, "%s: socket connect error\n", prog);
|
||||
goto end;
|
||||
|
||||
Reference in New Issue
Block a user