属性错误:'模块'对象没有属性' DTLSv1_METHOD'

时间:2017-02-20 19:30:33

标签: python ssl openssl pyopenssl

Attribute Error: 'module' object has no attribute 'DTLSv1_METHOD'

错误:

2019-09-11 12:00:00

Python 2.7.6

OpenSSL 1.1.0e

1 个答案:

答案 0 :(得分:-1)

  

Attribute Error: 'module' object has no attribute 'DTLSv1_METHOD'

我不确定Python提供什么,但让我告诉你OpenSSL在做什么。从下面,您可以尝试DTLS_methodDTLS_server_methodDTLS_client_method

OpenSSL的GitHub:

$ git clone https://github.com/openssl/openssl.git
$ cd openssl

OpenSSL 1.1.0(Master的提示):

$ git checkout master -f
$ grep -IR DTLS * | grep METHOD | grep ssl.h
...
include/openssl/ssl.h:# ifndef OPENSSL_NO_DTLS1_METHOD
include/openssl/ssl.h:# ifndef OPENSSL_NO_DTLS1_METHOD
include/openssl/ssl.h:DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *DTLSv1_method(void)) /* DTLSv1.0 */
include/openssl/ssl.h:DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *DTLSv1_server_method(void)) /* DTLSv1.0 */
include/openssl/ssl.h:DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *DTLSv1_client_method(void)) /* DTLSv1.0 */
include/openssl/ssl.h:# ifndef OPENSSL_NO_DTLS1_2_METHOD
include/openssl/ssl.h:DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *DTLSv1_2_method(void)) /* DTLSv1.2 */
include/openssl/ssl.h:DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *DTLSv1_2_server_method(void)) /* DTLSv1.2 */
include/openssl/ssl.h:DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *DTLSv1_2_client_method(void)) /* DTLSv1.2 */
include/openssl/ssl.h:__owur const SSL_METHOD *DTLS_method(void); /* DTLS 1.0 and 1.2 */
include/openssl/ssl.h:__owur const SSL_METHOD *DTLS_server_method(void); /* DTLS 1.0 and 1.2 */
include/openssl/ssl.h:__owur const SSL_METHOD *DTLS_client_method(void); /* DTLS 1.0 and 1.2 */

和OpenSSL 1.0.2:

$ git checkout OpenSSL_1_0_2-stable
$ grep -IR DTLS * | grep METHOD | grep ssl.h
ssl/ssl.h:const SSL_METHOD *DTLSv1_method(void); /* DTLSv1.0 */
ssl/ssl.h:const SSL_METHOD *DTLSv1_server_method(void); /* DTLSv1.0 */
ssl/ssl.h:const SSL_METHOD *DTLSv1_client_method(void); /* DTLSv1.0 */
ssl/ssl.h:const SSL_METHOD *DTLSv1_2_method(void); /* DTLSv1.2 */
ssl/ssl.h:const SSL_METHOD *DTLSv1_2_server_method(void); /* DTLSv1.2 */
ssl/ssl.h:const SSL_METHOD *DTLSv1_2_client_method(void); /* DTLSv1.2 */
ssl/ssl.h:const SSL_METHOD *DTLS_method(void); /* DTLS 1.0 and 1.2 */
ssl/ssl.h:const SSL_METHOD *DTLS_server_method(void); /* DTLS 1.0 and 1.2 */
ssl/ssl.h:const SSL_METHOD *DTLS_client_method(void); /* DTLS 1.0 and 1.2 */

您可以在docs/manpages.html找到OpenSSL手册页。