Revision db4e138b lib/http/__init__.py
b/lib/http/__init__.py | ||
---|---|---|
1 | 1 |
# |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2007, 2008 Google Inc. |
|
4 |
# Copyright (C) 2007, 2008, 2010 Google Inc.
|
|
5 | 5 |
# |
6 | 6 |
# This program is free software; you can redistribute it and/or modify |
7 | 7 |
# it under the terms of the GNU General Public License as published by |
... | ... | |
570 | 570 |
self._ssl_key = None |
571 | 571 |
self._ssl_cert = None |
572 | 572 |
|
573 |
def _CreateSocket(self, ssl_params, ssl_verify_peer): |
|
573 |
def _CreateSocket(self, ssl_params, ssl_verify_peer, family):
|
|
574 | 574 |
"""Creates a TCP socket and initializes SSL if needed. |
575 | 575 |
|
576 | 576 |
@type ssl_params: HttpSslParams |
... | ... | |
578 | 578 |
@type ssl_verify_peer: bool |
579 | 579 |
@param ssl_verify_peer: Whether to require client certificate |
580 | 580 |
and compare it with our certificate |
581 |
@type family: int |
|
582 |
@param family: socket.AF_INET | socket.AF_INET6 |
|
581 | 583 |
|
582 | 584 |
""" |
583 |
self._ssl_params = ssl_params
|
|
585 |
assert family in (socket.AF_INET, socket.AF_INET6)
|
|
584 | 586 |
|
585 |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
|
587 |
self._ssl_params = ssl_params |
|
588 |
sock = socket.socket(family, socket.SOCK_STREAM) |
|
586 | 589 |
|
587 | 590 |
# Should we enable SSL? |
588 | 591 |
self.using_ssl = ssl_params is not None |
Also available in: Unified diff