Commit 6f0105e2 authored by venaas's avatar venaas Committed by venaas
Browse files

don't exit when ssl_accept fails

git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@62 e88ac4ed-0b26-0410-9574-a7f39faa03bf
parent 60ec14c1
......@@ -1479,13 +1479,14 @@ void *tlsserverrd(void *arg) {
if (SSL_accept(ssl) <= 0) {
while ((error = ERR_get_error()))
err("tlsserverrd: SSL: %s", ERR_error_string(error, NULL));
errx("accept failed, child exiting");
printf("SSL_accept failed\n");
goto errexit;
}
if (tlsverifycert(&client->peer)) {
if (pthread_create(&tlsserverwrth, NULL, tlsserverwr, (void *)client))
errx("pthread_create failed");
if (pthread_create(&tlsserverwrth, NULL, tlsserverwr, (void *)client)) {
err("pthread_create failed");
goto errexit;
}
for (;;) {
buf = radtlsget(client->peer.ssl);
if (!buf)
......@@ -1508,6 +1509,8 @@ void *tlsserverrd(void *arg) {
printf("tlsserverrd: waiting for writer to end\n");
pthread_join(tlsserverwrth, NULL);
}
errexit:
s = SSL_get_fd(ssl);
SSL_free(ssl);
close(s);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment