Fix to build better with DJGPP.
[openssl.git] / demos / ssl / cli.cpp
index bab4e47d67a88bec39d63f4fec41ce5b5f53bae1..49cba5da0c81d1bbf724a2af82656ac36a901c03 100644 (file)
@@ -14,7 +14,6 @@
 #include <arpa/inet.h>
 #include <netdb.h>
 
-#include "rsa.h"       /* SSLeay stuff */
 #include <openssl/crypto.h>
 #include <openssl/x509.h>
 #include <openssl/pem.h>
@@ -80,12 +79,12 @@ void main ()
   str = X509_NAME_oneline (X509_get_subject_name (server_cert),0,0);
   CHK_NULL(str);
   printf ("\t subject: %s\n", str);
-  Free (str);
+  OPENSSL_free (str);
 
   str = X509_NAME_oneline (X509_get_issuer_name  (server_cert),0,0);
   CHK_NULL(str);
   printf ("\t issuer: %s\n", str);
-  Free (str);
+  OPENSSL_free (str);
 
   /* We could do all sorts of certificate verification stuff here before
      deallocating the certificate. */
@@ -97,11 +96,10 @@ void main ()
 
   err = SSL_write (ssl, "Hello World!", strlen("Hello World!"));  CHK_SSL(err);
   
-  SSL_shutdown (ssl);  /* send SSL/TLS close_notify */
-  
   err = SSL_read (ssl, buf, sizeof(buf) - 1);                     CHK_SSL(err);
   buf[err] = '\0';
   printf ("Got %d chars:'%s'\n", err, buf);
+  SSL_shutdown (ssl);  /* send SSL/TLS close_notify */
 
   /* Clean up. */