- Imported fix from trunk

diff --git a/library/debug.c b/library/debug.c
index 6471706..b3855db 100644
--- a/library/debug.c
+++ b/library/debug.c
@@ -184,7 +184,7 @@
     prefix[maxlen] = '\0';
     maxlen = sizeof( str ) - 1;
 
-    while( crt != NULL && crt->version != 0 )
+    while( crt != NULL )
     {
         char buf[1024];
         x509parse_cert_info( buf, sizeof( buf ) - 1, prefix, crt );
diff --git a/library/ssl_srv.c b/library/ssl_srv.c
index 6737545..614d32c 100644
--- a/library/ssl_srv.c
+++ b/library/ssl_srv.c
@@ -488,7 +488,7 @@
     p += 2;
     crt = ssl->ca_chain;
 
-    while( crt != NULL && crt->version != 0 )
+    while( crt != NULL )
     {
         if( p - buf > 4096 )
             break;
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index d5e1c27..7f187e2 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -1160,7 +1160,7 @@
     i = 7;
     crt = ssl->own_cert;
 
-    while( crt != NULL && crt->version != 0 )
+    while( crt != NULL )
     {
         n = crt->raw.len;
         if( i + 3 + n > SSL_MAX_CONTENT_LEN )