Cannot make https requst to jupyter notebook from pycharm

Answered

I have jupyter lab runnig on remote server on https.  When i try to run a notebook from pycharm  using configured server, the following is the error on jupyter lab console 

SSL Error on 10('1x.x.x.x', 62551): [SSL: HTTP_REQUEST] http request (_ssl.c:1076)

 

I am using pycharm 2020.1.3

 

0
12 comments

Similar issue https://youtrack.jetbrains.com/issue/PY-35376

Could you please provide Logs from **Help | Collect Logs and Diagnostic Data** ?

You can upload files to https://uploads.jetbrains.com/ and provide the upload id here.

0
Avatar
Permanently deleted user

here it is 2020_07_23_CoxruVqLdfpMhyYz

0
Avatar
Permanently deleted user

I had a look at the related issues, I am not sure how others are still having a problem after it was reported as solved. I did install the ca certs into the using java keytool, however I have no idea which ca store is used by pycharm. could you please help us with the correct ca store pycharm uses?

 

Please note: I tried disabling https on my remote jupyter notebook server and pycharm works fine over http, but i dont want to leave remote notebook unsecured

0

Thank you, 

>I have no idea which ca store is used by pycharm

Let me get more info and I'll get back to you later on this.

Meanwhile, are you able to access your remote notebook from browser over HTTPS? Is connection fully protected when you do that? (no waring about self-signed certificate and such)?

0
Avatar
Permanently deleted user

Yes I am able to access the remote notebook from browser using https and the connection is protected. I am using certs from letsencrypt and not using self signed certs. There are no warnings as well about the connection.

 

Thank You

0

Here's a comment from user who also use "letsencrypt" certificates and had similar issue: https://youtrack.jetbrains.com/issue/PY-35376#focus=Comments-27-3673343.0-0

Could you please try his recommendation?

0
Avatar
Permanently deleted user

Yes, In fact, i have started my work around with their recommendation. for some reason it doesnt seem to work.

0

Hey, sorry for the late reply.

PyCharm is using the default keystore which is located in `<IDE_HOME>/jbr/lib/security/cacerts`

You can import certificates there using keytool, or you can make a copy of this keystore and specify it in VM options.

You may find this article useful: https://magicmonster.com/kb/prg/java/ssl/pkix_path_building_failed/

0
Avatar
Permanently deleted user

Prior to adding to the PyCharm keystore, it wouldn't even connect.

After adding the self-signed cert to keystore based on above instructions, the configured server is accepted and connected.

However, when executing notebook cells, requests to the notebook server are still made over http vs https resulting in the following error on the notebook server:

W 02:49:16.578 NotebookApp] SSL Error on 12 ('<ip address>', 64072): [SSL: HTTP_REQUEST] http request (_ssl.c:852)

 

 

 

0
Avatar
Permanently deleted user

I too followed solution provided by Andrey Resler to add the SSL certificate of remote jupyter hub server.

I can connect to jupyterhub server and can see the published file.

but in Pycharm I get "Run Error" and no result preview.

when checked "idea.log" below is the error message "Unhandled Jupyter error "

/Users/<user>/Library/Logs/JetBrains/PyCharm2020.3/idea.log

2021-02-05 00:07:29,976 [31472575] INFO - ion.JupyterWebSocketClientImpl - Received onClose(-1, "", true) for org.jetbrains.plugins.notebooks.jupyter.connections.execution.JupyterWebSocketClientImpl$WebSocketClientImpl@2e1f026d
2021-02-05 00:07:29,977 [31472576] ERROR - ctions.ui.JupyterErrorReporter - Unhandled Jupyter error
org.jetbrains.plugins.notebooks.jupyter.connections.execution.JupyterExecutionException:
at org.jetbrains.plugins.notebooks.jupyter.connections.execution.JupyterWebSocketClientImpl$WebSocketClientImpl.onClose(JupyterWebSocketClient.kt:122)
at org.java_websocket.client.WebSocketClient.onWebsocketClose(WebSocketClient.java:523)
at org.java_websocket.WebSocketImpl.closeConnection(WebSocketImpl.java:504)
at org.java_websocket.WebSocketImpl.closeConnection(WebSocketImpl.java:515)
at org.java_websocket.WebSocketImpl.eot(WebSocketImpl.java:552)
at org.java_websocket.client.WebSocketClient.run(WebSocketClient.java:419)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-02-05 00:07:29,979 [31472578] ERROR - ctions.ui.JupyterErrorReporter - PyCharm 2020.3.3 Build #PY-203.7148.72
2021-02-05 00:07:29,980 [31472579] ERROR - ctions.ui.JupyterErrorReporter - JDK: 11.0.9.1; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2021-02-05 00:07:29,980 [31472579] ERROR - ctions.ui.JupyterErrorReporter - OS: Mac OS X
2021-02-05 00:07:29,981 [31472580] ERROR - ctions.ui.JupyterErrorReporter - Last Action: NotebookRunAllAction

 

 

 

 

 

0

Manjilsubba

Please report it to https://youtrack.jetbrains.com/issues/PY and attach your idea.log

We'll investigate.

0
Avatar
Permanently deleted user

Sergey Karpov 

Thank you,

I have reported as mentioned https://youtrack.jetbrains.com/issue/PY-47160 

Regards,

Manjil

0

Please sign in to leave a comment.