- 学习路线
- RT-Thread 简介
- RT-Thread Nano
- RT-Thread Smart
- RT-Thread Studio
- 快速上手
- 内核
- Env 工具
- 设备和驱动
- 组件
- 软件包
- 物联网
- 工具
- MicroPython用户手册
- 应用开发
- RT-Thread 版本选择
- 开发环境搭建
- 固件尺寸优化
- 在RT-Thread潘多拉开发板上实现电源管理
- 网络协议栈驱动移植
- 在STM32F429上应用网络功能
- 在STM32F429上应用文件系统
- 在潘多拉上使用 SFUD 操作 Flash
- FreeModbus 应用笔记
- 应用AT组件连接ESP8266模块
- 多线程非阻塞网络编程
- 使用QEMU运行动态模块组件
- CmBacktrace应用
- 在 STM32L4 上应用 littlefs 文件系统
- STM32通用Bootloader
- wireshark抓取tls数据包
- 在 STM32 上应用 C++
- STM32 上使用 PWM
- STM32 上使用 USB Host 读写 U 盘
- QEMU 网络视频教程
- Demo 示例
- 其他
- 传感器驱动开发指南
- 软件包开发
- 向RT-Thread贡献代码
- 内核视频教程
- Env 视频教程
- rw007 SPI WiFi 模块使用
- wireshark抓取tls数据包
- Keil MDK 安装
- Rtthread dir
- 支持的传感器列表
- 支持的 Touch 列表
- Builtin functions and exceptions
- Cmath
- Gc
- Math
- Sys
- Uarray
- Ubinascii
- Ucollections
- Uerrno
- Uhashlib
- Uheapq
- Uio
- Ujson
- Uos
- Ure
- Uselect
- Usocket
- ussl – SSL/TLS 模块
- Ustruct
- Utime
- Uzlib
- thread
- micropython – 内部功能访问与控制模块
- Rtthread
- Machine
- Pin
- I2C
- SPI
- UART
- LCD
- RTC
- PWM
- ADC
- WDT
- Timer
- Network
- Wlan
- 传感器驱动框架介绍
- Preparations
ussl – SSL/TLS 模块
This module implements a subset of the corresponding CPython
module, as described below. For more information, refer to the original CPython documentation: ssl
.
This module provides access to Transport Layer Security (previously and widely known as “Secure Sockets Layer”) encryption and peer authentication facilities for network sockets, both client-side and server-side.
功能函数
ussl.wrap_socket
(sock, server_side=False, keyfile=None, certfile=None, cert_reqs=CERT_NONE, ca_certs=None)
Takes a stream
sock (usually usocket.socket instance of SOCK_STREAM
type), and returns an instance of ssl.SSLSocket, which wraps the underlying stream in an SSL context. Returned object has the usual stream
interface methods like read()
, write()
, etc. In MicroPython, the returned object does not expose socket interface and methods like recv()
, send()
. In particular, a server-side SSL socket should be created from a normal socket returned fromaccept()
on a non-SSL listening server socket. Depending on the underlying module implementation in a particular MicroPython port
, some or all keyword arguments above may be not supported.
Warning: Some implementations of ussl
module do NOT validate server certificates, which makes an SSL connection established prone to man-in-the-middle attacks.
异常类型
ssl.SSLError
This exception does NOT exist. Instead its base class, OSError, is used.
常量
ussl.CERT_NONE
ussl.CERT_OPTIONAL
ussl.CERT_REQUIRED
- Supported values for cert_reqs parameter.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论