Подтвердить что ты не робот

(Установка Python 3.6.1) SSLError: SSL: TLSV1_ALERT_UNKNOWN_CA tlsv1 предупреждение неизвестно ca

Я пытаюсь установить Python 3.6 из источника на Ubuntu 16.10.

make test

когда я делаю тест, установка вызывает ошибку.

======================================================================
ERROR: test_logincapa_with_client_certfile (test.test_imaplib.RemoteIMAP_SSLTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/anderson/Downloads/Python-3.6.1/Lib/test/test_imaplib.py", line 973, in test_logincapa_with_client_certfile
    certfile=CERTFILE)
  File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 1280, in __init__
    IMAP4.__init__(self, host, port)
  File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 197, in __init__
    self.open(host, port)
  File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 1293, in open
    IMAP4.open(self, host, port)
  File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 294, in open
    self.sock = self._create_socket()
  File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 1285, in _create_socket
    server_hostname=self.host)
  File "/home/anderson/Downloads/Python-3.6.1/Lib/ssl.py", line 401, in wrap_socket
    _context=self, _session=session)
  File "/home/anderson/Downloads/Python-3.6.1/Lib/ssl.py", line 808, in __init__
    self.do_handshake()
  File "/home/anderson/Downloads/Python-3.6.1/Lib/ssl.py", line 1061, in do_handshake
    self._sslobj.do_handshake()
  File "/home/anderson/Downloads/Python-3.6.1/Lib/ssl.py", line 683, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:749)

======================================================================
ERROR: test_logincapa_with_client_ssl_context (test.test_imaplib.RemoteIMAP_SSLTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/anderson/Downloads/Python-3.6.1/Lib/test/test_imaplib.py", line 979, in test_logincapa_with_client_ssl_context
    self.host, self.port, ssl_context=self.create_ssl_context())
  File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 1280, in __init__
    IMAP4.__init__(self, host, port)
  File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 197, in __init__
    self.open(host, port)
  File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 1293, in open
    IMAP4.open(self, host, port)
  File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 294, in open
    self.sock = self._create_socket()
  File "/home/anderson/Downloads/Python-3.6.1/Lib/imaplib.py", line 1285, in _create_socket
    server_hostname=self.host)
  File "/home/anderson/Downloads/Python-3.6.1/Lib/ssl.py", line 401, in wrap_socket
    _context=self, _session=session)
  File "/home/anderson/Downloads/Python-3.6.1/Lib/ssl.py", line 808, in __init__
    self.do_handshake()
  File "/home/anderson/Downloads/Python-3.6.1/Lib/ssl.py", line 1061, in do_handshake
    self._sslobj.do_handshake()
  File "/home/anderson/Downloads/Python-3.6.1/Lib/ssl.py", line 683, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:749)

----------------------------------------------------------------------
Ran 95 tests in 21.126s

FAILED (errors=2)
test test_imaplib failed
1 test failed again:
    test_imaplib

Total duration: 3 min 9 sec
Tests result: FAILURE
Makefile:1018: recipe for target 'test' failed
make: *** [test] Error 1

какая проблема?

4b9b3361

Ответ 1

похоже, что указанный вами код не существует в предыдущих или новых ветках.

однако эта конкретная ошибка говорит, что CA не является действительным (доверенным) CA.

при проверке конкретного кода кажется, что ключ - keycert3.pem в папке lib/test.

Файл CA - pycacert.pem, вы можете добавить этот CA в список доверенных вашей машине. Вы можете увидеть ответы на суперпользователя, как https://superuser.com/questions/437330/how-do-you-add-a-certificate-authority-ca-to-ubuntu

которые определяют, как это сделать, хотя я, кажется, помню, что достаточно просто скопировать файл в /etc/ssl/certs. Надеюсь, это поможет.

Ответ 2

Прежде всего, установите Python 3.6 с их официального сайта:

cd /opt sudo wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz затем распакуйте его

sudo tar -xvf Python-3.6.3.tgz

Это должно работать для вас!