Revision 45317e3a lib/http/__init__.py
b/lib/http/__init__.py | ||
---|---|---|
1 | 1 |
# |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2007, 2008, 2010 Google Inc. |
|
4 |
# Copyright (C) 2007, 2008, 2010, 2012 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 |
... | ... | |
530 | 530 |
raise HttpError("Error in SSL handshake: %s" % err) |
531 | 531 |
|
532 | 532 |
|
533 |
def InitSsl(): |
|
534 |
"""Initializes the SSL infrastructure. |
|
535 |
|
|
536 |
This function is idempotent. |
|
537 |
|
|
538 |
""" |
|
539 |
if not OpenSSL.rand.status(): |
|
540 |
raise EnvironmentError("OpenSSL could not collect enough entropy" |
|
541 |
" for the PRNG") |
|
542 |
|
|
543 |
# TODO: Maybe add some additional seeding for OpenSSL's PRNG |
|
544 |
|
|
545 |
|
|
546 | 533 |
class HttpSslParams(object): |
547 | 534 |
"""Data class for SSL key and certificate. |
548 | 535 |
|
Also available in: Unified diff