.net - IronPython urllib2 Basic Auth Exceptions? (Shopify) -



.net - IronPython urllib2 Basic Auth Exceptions? (Shopify) -

i'm creating private shopify app, uses basic authentication. programme written in ironpython, however, i'm having problem getting urllib2 working.

i've tried solution here: python urllib2 basic auth problem

and works expected plain python, when run ironpython, error:

ioerror: system.io.ioexception: unable read info transport connection: existing connection forcibly closed remote host. ---> system.net.sockets.socketexception: existing connection forcibly closed remote host @ system.net.sockets.socket.receive(byte[] buffer, int32 offset, int32 size, socketflags socketflags) @ system.net.sockets.networkstream.read(byte[] buffer, int32 offset, int32 size) --- end of inner exception stack trace --- @ microsoft.scripting.runtime.lightexceptions.checkandthrow(object value) @ dlrcachedcode.do_open$5398(closure , pythonfunction $function, object self, object http_class, object req) @ ironpython.runtime.functioncaller`3.call3(callsite site, codecontext context, object func, t0 arg0, t1 arg1, t2 ar...

i tried .net solution in ironpython (not using urllib2) , works, using method: http://www.ironpython.info/index.php?title=fetching_a_page_with_basic_authentication

is there magic going on behind scenes (python -> .net) causing not work?

current version of ironpython defaults ssl v2. assuming server accepting tls1 need next before utilize urllib2

import ssl import functools old_init = ssl.sslsocket.__init__ @functools.wraps(old_init) def init_with_tls1(self, *args, **kwargs): kwargs['ssl_version'] = ssl.protocol_tlsv1 old_init(self, *args, **kwargs) ssl.sslsocket.__init__ = init_with_tls1

.net urllib2 ironpython shopify

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -