aboutsummaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/socket.c b/socket.c
index 172c5ee0..db04734d 100644
--- a/socket.c
+++ b/socket.c
@@ -942,7 +942,7 @@ int SSLOpen(int sock, char *mycert, char *mykey, char *myproto, int certck, char
if( !mycert )
mycert = mykey;
- if (SSLCertGetCN(mycert, buffer, sizeof(buffer))) {
+ if ((!*remotename || !**remotename) && SSLCertGetCN(mycert, buffer, sizeof(buffer))) {
free(*remotename);
*remotename = xstrdup(buffer);
}