diff --git a/lib/gtls.c b/lib/gtls.c
index d8e88e2c4b5ab63939ec7c4e221c62b4edd412ca..a17d9eeda2a67e0594b1c68ec9a1156a18a841ff 100644
--- a/lib/gtls.c
+++ b/lib/gtls.c
@@ -304,7 +304,7 @@ static CURLcode handshake(struct connectdata *conn,
         return CURLE_OK;
     }
     else if((rc < 0) && !gnutls_error_is_fatal(rc)) {
-      char *strerr = NULL;
+      const char *strerr = NULL;
 
       if(rc == GNUTLS_E_WARNING_ALERT_RECEIVED) {
         int alert = gnutls_alert_get(session);
@@ -317,7 +317,7 @@ static CURLcode handshake(struct connectdata *conn,
       failf(data, "gnutls_handshake() warning: %s", strerr);
     }
     else if(rc < 0) {
-      char *strerr = NULL;
+      const char *strerr = NULL;
 
       if(rc == GNUTLS_E_FATAL_ALERT_RECEIVED) {
         int alert = gnutls_alert_get(session);