| 432 | """ |
| 433 | |
| 434 | def __init__(self, host, port=POP3_SSL_PORT, keyfile=None, certfile=None, |
| 435 | timeout=socket._GLOBAL_DEFAULT_TIMEOUT, context=None): |
| 436 | if context is not None and keyfile is not None: |
| 437 | raise ValueError("context and keyfile arguments are mutually " |
| 438 | "exclusive") |
| 439 | if context is not None and certfile is not None: |
| 440 | raise ValueError("context and certfile arguments are mutually " |
| 441 | "exclusive") |
| 442 | if keyfile is not None or certfile is not None: |
| 443 | import warnings |
| 444 | warnings.warn("keyfile and certfile are deprecated, use a " |
| 445 | "custom context instead", DeprecationWarning, 2) |
| 446 | self.keyfile = keyfile |
| 447 | self.certfile = certfile |
| 448 | if context is None: |
| 449 | context = ssl._create_stdlib_context(certfile=certfile, |
| 450 | keyfile=keyfile) |
| 451 | self.context = context |
| 452 | POP3.__init__(self, host, port, timeout) |
| 453 | |
| 454 | def _create_socket(self, timeout): |
| 455 | sock = POP3._create_socket(self, timeout) |