- Timestamp:
- 07/27/12 00:35:15 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
etherws/trunk/etherws.py
r179 r180 444 444 445 445 446 def ssl_wrapper(insecure, ca_certs): 447 args = {'cert_reqs': ssl.CERT_REQUIRED, 'ca_certs': ca_certs} 448 if insecure: 449 args = {} 450 return lambda sock: ssl.wrap_socket(sock, **args) 451 452 446 453 def server_main(args): 447 454 realpath(args, 'keyfile', 'certfile', 'htpasswd') … … 491 498 websocket.enableTrace(True) 492 499 493 if args.insecure:494 websocket._SSLSocketWrapper = \495 lambda s: ssl.wrap_socket(s)496 else:497 websocket._SSLSocketWrapper = \498 lambda s: ssl.wrap_socket(s, cert_reqs=ssl.CERT_REQUIRED,499 ca_certs=args.cacerts)500 501 500 if args.ageout <= 0: 502 501 raise ValueError('invalid ageout: %s' % args.ageout) … … 505 504 args.passwd = getpass.getpass() 506 505 506 websocket._SSLSocketWrapper = ssl_wrapper(args.insecure, args.cacerts) 507 507 cred = {'user': args.user, 'passwd': args.passwd} 508 508 ioloop = tornado.ioloop.IOLoop.instance()
Note: See TracChangeset
for help on using the changeset viewer.