From ad4efb8d59be51e74b747fa5aa90994446c2a5a0 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 26 Jun 2012 23:53:59 +0000 Subject: [PATCH] add python bindings for SSL support --- ChangeLog | 1 + bindings/python/src/alert.cpp | 4 ++++ bindings/python/src/create_torrent.cpp | 1 + bindings/python/src/torrent_handle.cpp | 1 + 4 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 459e34b32..61a28acf8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ * fix nagle implementation in uTP + * add python bindings for SSL support * minor uTP tweaks * fix end-game mode issue when some files are selected to not be downloaded * improve uTP slow start diff --git a/bindings/python/src/alert.cpp b/bindings/python/src/alert.cpp index 3a12596b3..1e12db551 100644 --- a/bindings/python/src/alert.cpp +++ b/bindings/python/src/alert.cpp @@ -458,4 +458,8 @@ void bind_alert() .def_readonly("socket_type", &incoming_connection_alert::socket_type) .add_property("ip", &incoming_connection_alert_ip) ; + class_, noncopyable>( + "torrent_need_cert_alert", no_init) + .def_readonly("error", &torrent_need_cert_alert::error) + ; } diff --git a/bindings/python/src/create_torrent.cpp b/bindings/python/src/create_torrent.cpp index db7a867e3..aa53c2cfe 100644 --- a/bindings/python/src/create_torrent.cpp +++ b/bindings/python/src/create_torrent.cpp @@ -128,6 +128,7 @@ void bind_create_torrent() .def("piece_length", &create_torrent::piece_length) .def("piece_size", &create_torrent::piece_size) .def("priv", &create_torrent::priv) + .def("set_root_cert", &create_torrent::set_root_cert, (arg("pem"))) ; enum_("create_torrent_flags_t") diff --git a/bindings/python/src/torrent_handle.cpp b/bindings/python/src/torrent_handle.cpp index c330c1f87..430a4551c 100644 --- a/bindings/python/src/torrent_handle.cpp +++ b/bindings/python/src/torrent_handle.cpp @@ -390,6 +390,7 @@ void bind_torrent_handle() .def("info_hash", _(&torrent_handle::info_hash)) .def("force_recheck", _(&torrent_handle::force_recheck)) .def("rename_file", _(rename_file0)) + .def("set_ssl_certificate", &torrent_handle::set_ssl_certificate, (arg("cert"), arg("private_key"), arg("dh_params"), arg("passphrase")="")) #if TORRENT_USE_WSTRING .def("move_storage", _(move_storage1)) .def("rename_file", _(rename_file1))