Сертификат сервера не является доверенным решением
Решите проблему, заключающуюся в том, что при запуске pycharm под окнами появляется окно приглашения сертификата сервера.
Инструменты / Материалы
-
pycharm pro
-
windows10 64bit
Метод / шаг
-
явление:
После установки pycharm
Запустите pycharm, и появится окно с запросом о том, что сертификат сервера не является доверенным.
-
решить:
1: нажмите X в правом верхнем углу, чтобы закрыть интерфейс аутентификации;
2: щелкните раскрывающийся список настройки в правом нижнем углу интерфейса.
3: нажмите «Настройки»
-
4. Щелкните раскрывающийся список «Инструменты» справа.
5: Щелкните элемент Сертификаты сервера
6. Установите флажок «Не доверять сертификат автоматически», чтобы подтвердить выход.
-
4
7: перезапустить pycharm
Не отображается окно с запросом о том, что сертификат сервера не является доверенным.
I am trying to install the requests
library to my Python environment in PyCharm while on a company network that uses self-signed SSL certificates. As a result, installing a library with File > Settings > Project > Project Interpreter > Install
fails with an HTTPS error:
Collecting requests
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection
broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.
VerifiedHTTPSConnection object at 0x0368D5D0>: Failed to establish a new connection:
[Errno 11003] getaddrinfo failed',)': /simple/requests/
Could not find a version that satisfies the requirement requests (from versions: )
No matching distribution found for requests
I tried making pip
trust my company’s root certificate by adding --cert C:COMPANY-CAROOT.pem
to my install options, which was interpreted as:
pip install --cert C:COMPANY-CAROOT.pem requests
I also tried opening File > Settings > Project > Server Certificates
and checking Accept non-trusted certificates automatically, but ran into the same issue.
How can I get PyCharm to ignore SSL certificate errors when installing external libraries?
Go to Python
r/Python
r/Python
News about the programming language Python. If you have something to teach others post here. If you have questions or are a newbie use r/learnpython
Members
Online
•
by
[deleted]
PyCharm — SSL certificate error on company network. How can I fix this?
Sorry, this post was deleted by the person who originally posted it.
Archived post. New comments cannot be posted and votes cannot be cast.
I work on windows 7
this is my code
def Rup(x, y, w):
odleglosc = np.dot(x,w)-y
cost = np.sum(odleglosc**2) / (2*np.shape(x)[0])
return odleglosc, cost
def REG(data_1, data_2, data_3, Tu, cou):
i = 0
while i < cou:
dif, cost = Rup(data_1, data_2, data_3)
grad = np.dot(data_1.transpose(), dif) / np.shape(data_1)[0]
data_3 = data_3 - Tu * grad
if i%200==0:
print('Wyliczony error w ' + str(i) + " iteracji: ", cost)
i+=1;
return data_3
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.preprocessing import LabelEncoder
_DANE = 'https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data';
iris = pd.read_csv(_DANE, names=['sepal_length', 'sepal_width', 'petal_length', 'petal_width', 'label'])
le = LabelEncoder()
iris['label'] = le.fit_transform(iris['label'])
X = np.array(iris.drop(['petal_width'], axis=1))
y = np.array(iris['petal_width'])
iris.head()
cros = 1/1000
coun= 10000
_, features = np.shape(X)
wagi = np.zeros(features)
wektor = REG(X, y, wagi, cros, coun)
print('--------------------------------------------------')
print(wektor)
print('--------------------------------------------------')
dif, cost = Rup(X, y, wektor)
print('Szukany Error', cost)
the error message looks as follows
Traceback (most recent call last):
File «C:UserslukaszAppDataLocalProgramsPythonPython38-32liburllibrequest.py», line 1319, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File «C:UserslukaszAppDataLocalProgramsPythonPython38-32libhttpclient.py», line 1230, in request
self._send_request(method, url, body, headers, encode_chunked)
File «C:UserslukaszAppDataLocalProgramsPythonPython38-32libhttpclient.py», line 1276, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File «C:UserslukaszAppDataLocalProgramsPythonPython38-32libhttpclient.py», line 1225, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File «C:UserslukaszAppDataLocalProgramsPythonPython38-32libhttpclient.py», line 1004, in _send_output
self.send(msg)
File «C:UserslukaszAppDataLocalProgramsPythonPython38-32libhttpclient.py», line 944, in send
self.connect()
File «C:UserslukaszAppDataLocalProgramsPythonPython38-32libhttpclient.py», line 1399, in connect
self.sock = self._context.wrap_socket(self.sock,
File «C:UserslukaszAppDataLocalProgramsPythonPython38-32libssl.py», line 500, in wrap_socket
return self.sslsocket_class._create(
File «C:UserslukaszAppDataLocalProgramsPythonPython38-32libssl.py», line 1040, in _create
self.do_handshake()
File «C:UserslukaszAppDataLocalProgramsPythonPython38-32libssl.py», line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File «C:/Users/lukasz/PycharmProjects/miw/test.py», line 26, in
iris = pd.read_csv(_DANE, names=['sepal_length', 'sepal_width', 'petal_length', 'petal_width', 'label'])
File «C:UserslukaszPycharmProjectsmiwvenvlibsite-packagespandasioparsers.py», line 685, in parser_f
return _read(filepath_or_buffer, kwds)
File «C:UserslukaszPycharmProjectsmiwvenvlibsite-packagespandasioparsers.py», line 439, in _read
fp_or_buf, _, compression, should_close = get_filepath_or_buffer(
File «C:UserslukaszPycharmProjectsmiwvenvlibsite-packagespandasiocommon.py», line 196, in get_filepath_or_buffer
req = urlopen(filepath_or_buffer)
File «C:UserslukaszAppDataLocalProgramsPythonPython38-32liburllibrequest.py», line 222, in urlopen
return opener.open(url, data, timeout)
File «C:UserslukaszAppDataLocalProgramsPythonPython38-32liburllibrequest.py», line 525, in open
response = self._open(req, data)
File «C:UserslukaszAppDataLocalProgramsPythonPython38-32liburllibrequest.py», line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File «C:UserslukaszAppDataLocalProgramsPythonPython38-32liburllibrequest.py», line 502, in _call_chain
result = func(*args)
File «C:UserslukaszAppDataLocalProgramsPythonPython38-32liburllibrequest.py», line 1362, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File «C:UserslukaszAppDataLocalProgramsPythonPython38-32liburllibrequest.py», line 1322, in do_open
raise URLError(err)
urllib.error.URLError:
Process finished with exit code 1
with the code should be all right because it works correctly on the pages of the online compiler
I don’t know how to deal with this problem
please help me
1 Answer
Sorted by:
Reset to default
0
There is an option to automatically accept «non-trusted» certificates but this should only be used if you are absolutely sure you are on a safe network.
If it’s the certificate that is causing the popup, it’s better to talk to your administrator and get it added to the trusted-certificates list.
https://www.jetbrains.com/help/pycharm/settings-tools-server-certificates.html
Improve this answer
edited Jun 7, 2019 at 16:23
Rich Michaels
2,8162 gold badges10 silver badges20 bronze badges
answered Jun 7, 2019 at 15:14
Coffee_AddictCoffee_Addict
1
Add a comment
|
Your Answer
Sign up or log in
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Name
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.
Not the answer you’re looking for? Browse other questions tagged
- python
- pycharm
or ask your own question.
Not the answer you’re looking for? Browse other questions tagged
- python
- pycharm
or ask your own question.