QUIC Front-End I/O API: Fix implementation of SSL_get_error
[openssl.git] / ssl / ssl_lib.c
index 39a334c98962a64c1a5a6725a0cdec08872cea6a..deb040e5efd459bb67897e16246350951686b456 100644 (file)
@@ -4411,6 +4411,14 @@ int SSL_get_error(const SSL *s, int i)
     if (i > 0)
         return SSL_ERROR_NONE;
 
+#ifndef OPENSSL_NO_QUIC
+    if (qc != NULL) {
+        reason = ossl_quic_get_error(qc, i);
+        if (reason != SSL_ERROR_NONE)
+            return reason;
+    }
+#endif
+
     if (sc == NULL)
         return SSL_ERROR_SSL;
 
@@ -4425,14 +4433,6 @@ int SSL_get_error(const SSL *s, int i)
             return SSL_ERROR_SSL;
     }
 
-#ifndef OPENSSL_NO_QUIC
-    if (qc != NULL) {
-        reason = ossl_quic_get_error(qc, i);
-        if (reason != SSL_ERROR_NONE)
-            return reason;
-    }
-#endif
-
 #ifndef OPENSSL_NO_QUIC
     if (qc == NULL)
 #endif