s2n 介绍
s2n 是来自亚马逊的一个 TLS/SSL 协议的实现,实现的目标是简单、快速安全。
示例代码:
/* Create a server mode connection handle */ struct s2n_connection *conn = s2n_connection_new(S2N_SERVER); if (conn == NULL) { ... error ... } /* Associate a connection with a file descriptor */ if (s2n_connection_set_fd(conn, fd) < 0) { ... error ... } /* Negotiate the TLS handshake */ int more; if (s2n_negotiate(conn, &more) < 0) { ... error ... } /* Write data to the connection */ int bytes_written; bytes_written = s2n_send(conn, "Hello World", sizeof("Hello World"), &more);
s2n 官网
https://github.com/awslabs/s2n
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。