⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sclient.c

📁 ssl的客户端和服务端源代码
💻 C
字号:
/* A simple SSL client.   It connects and then forwards data from/to the terminal   to/from the server*/#include "common.h"#include "client.h"#include "read_write.h"int main(argc,argv)  int argc;  char **argv;  {    SSL_CTX *ctx;    SSL *ssl;    BIO *sbio;    int sock;    /* Build our SSL context*/    ctx=initialize_ctx(KEYFILE,PASSWORD);    /* Connect the TCP socket*/    sock=tcp_connect();    /* Connect the SSL socket */    ssl=SSL_new(ctx);    sbio=BIO_new_socket(sock,BIO_NOCLOSE);    SSL_set_bio(ssl,sbio,sbio);    if(SSL_connect(ssl)<=0)      berr_exit("SSL connect error");    check_cert_chain(ssl,HOST);    /* read and write */    read_write(ssl,sock);    destroy_ctx(ctx);  }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -