I have a working Jupyter server running on an EMR master node where I can run python and pyspark code with no issue. When trying to get the VS Code Python extension to connect to the very same Jupyter server, I get the following error:
Failed to connect to remote Jupyter notebook.
Check that the Jupyter Server URI setting has a valid running server specified.
http://***.***.***.***:8888/lab
Error: Invalid response: 405 Method Not Allowed
I created my own self-signed certificate on the EMR cluster by following these instructions from IBM. Then added the certificate to Chrome following these stack overflow instructions another user linked to on GitHub.
From the bash terminal of the EMR master node:
# create key and cert
openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem
# combine key and cert
openssl pkcs12 -inkey key.pem -in certificate.pem -export -out certificate.p12
Downloaded certificate.p12
to my local computer, and then adding to Chrome: chrome://settings/privacy
> Manage certificates > Import > Select and import certificate.p12
> Restarting VS Code.
I still get the same error.
- Should I create either the
key.pem
andcertificate.pem
on my local then combine into a certificate? - Do I need to use the original
.pem
key issued when creating the EMR cluster?