X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=client%2Fclient.c;h=c34d201d56e0c4c0dd76628c24384216b1ceb453;hb=f59f3bba11d2db2fa291b736a98bf2f9f7e8f6c0;hp=e0e1fd769eedbcae3feb3f53b19d4158206c6e83;hpb=3c4ae8968ea8fd87db472a14b6dcd2900553f430;p=yaz-moved-to-github.git diff --git a/client/client.c b/client/client.c index e0e1fd7..c34d201 100644 --- a/client/client.c +++ b/client/client.c @@ -33,15 +33,6 @@ #include #endif -#if HAVE_OPENSSL_SSL_H -#include -#include -#include -#include -#include -#include -#endif - #ifdef WIN32 #include #include @@ -676,9 +667,6 @@ int session_connect(const char *arg) void *add; char type_and_host[101]; const char *basep = 0; -#if HAVE_OPENSSL_SSL_H - SSL *ssl; -#endif if (conn) { cs_close(conn); @@ -731,30 +719,7 @@ int session_connect(const char *arg) return 0; } printf("OK.\n"); -#if HAVE_OPENSSL_SSL_H - if ((ssl = (SSL *) cs_get_ssl(conn))) - { - X509 *server_cert = SSL_get_peer_certificate (ssl); - - if (server_cert) - { - char *pem_buf; - int pem_len; - BIO *bio = BIO_new(BIO_s_mem()); - - /* get PEM buffer in memory */ - PEM_write_bio_X509(bio, server_cert); - pem_len = BIO_get_mem_data(bio, &pem_buf); - fwrite(pem_buf, pem_len, 1, stdout); - - /* print all info on screen .. */ - X509_print_fp(stdout, server_cert); - BIO_free(bio); - - X509_free (server_cert); - } - } -#endif + cs_print_session_info(conn); if (basep && *basep) set_base (basep); if (protocol == PROTO_Z3950) @@ -3313,6 +3278,12 @@ int cmd_format(const char *arg) { if (!strcmp(form_str, "none")) break; + if (!yaz_string_to_oid_odr(yaz_oid_std(), CLASS_RECSYN, form_str, out)) + { + printf("Bad format: %s\n", form_str); + recordsyntax_size = 0; + return 0; + } recordsyntax_list[idx] = xstrdup(form_str); cp += nor; idx++;