-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixes for neuromorpho interface #148
base: master
Are you sure you want to change the base?
Conversation
Thanks! This has been a thorn in my side for a while. I had some local changes sitting around where I used I would also suggest being transparent about switching off verification. For e.g. you could have verification on by default and catch the SSL error adding a note that users can call the function with Thoughts? |
I agree that import requests
url = "https://neuromorpho.org/dableFiles/nathans/CNG%20version/skin2-10x-7.CNG.swc"
response = requests.get(url, verify=False) throws the following error
Additionally, this seems to work without SSL errors but returns the wrong string. import requests
url = "http://cng.gmu.edu:8080/dableFiles/nathans/CNG%20version/skin2-10x-7.CNG.swc"
response = requests.get(url)
print(response.text) returns <html><head><title>Apache Tomcat/7.0.54 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /dableFiles/nathans/CNG%20version/skin2-10x-7.CNG.swc</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/dableFiles/nathans/CNG%20version/skin2-10x-7.CNG.swc</u></p><p><b>description</b> <u>The requested resource is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.54</h3></body></html> I agree that the user should explicitly set disabling verification. I am happy to update my code after we decide which route to take. |
FWIW I managed to find a workaround for requests: import requests
requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS += 'DEFAULT:!DH'
url = "https://neuromorpho.org/dableFiles/nathans/CNG%20version/skin2-10x-7.CNG.swc"
response = requests.get(url, verify=False) |
This PR fixes errors in the navis neuromorpho interface. It seems like one of the URLs was deprecated, so I added the new, up-to-date one (http://cng.gmu.edu:8080/). Also,
get_neuron
previously threw an SSL error when requesting .swc files from theneuromorpho
server. I added a workaround that pulls the files usingpycurl
, which works more reliably.