This works by detecting if 'https:' appears in the url-or-port string,
which will be the case if you call `ein:notebooklist-open` using https:
+ url + port.

Note also that on windows, at least, I get SSL errors when using curl as
request backend. Using url-retrieve eliminates the errors and SSL access
works as advertised.
This commit is contained in:
John Miller 2016-03-30 21:32:14 -05:00
parent ca0557b029
commit 847d4a0d3e

View file

@ -146,7 +146,6 @@
(ein:url (ein:$kernel-url-or-port kernel) (ein:url (ein:$kernel-url-or-port kernel)
"api/sessions") "api/sessions")
:type "POST" :type "POST"
:data (json-encode `(("notebook" . :data (json-encode `(("notebook" .
(("name" . ,notebook-id) (("name" . ,notebook-id)
("path" . ,path))))) ("path" . ,path)))))
@ -207,7 +206,10 @@
(defun ein:kernel--ws-url (url-or-port &optional securep) (defun ein:kernel--ws-url (url-or-port &optional securep)
"Use `ein:$kernel-url-or-port' if BASE_URL is an empty string. "Use `ein:$kernel-url-or-port' if BASE_URL is an empty string.
See: https://github.com/ipython/ipython/pull/3307" See: https://github.com/ipython/ipython/pull/3307"
(let ((protocol (if securep "wss" "ws"))) (let ((protocol (if (or securep
(string-match "^https://" url-or-port))
"wss"
"ws")))
(if (integerp url-or-port) (if (integerp url-or-port)
(format "%s://127.0.0.1:%s" protocol url-or-port) (format "%s://127.0.0.1:%s" protocol url-or-port)
(let* ((url (if (string-match "^https?://" url-or-port) (let* ((url (if (string-match "^https?://" url-or-port)