{"id":148,"date":"2009-08-30T14:03:43","date_gmt":"2009-08-30T06:03:43","guid":{"rendered":"http:\/\/depannone.com\/wordpress\/?p=148"},"modified":"2009-08-30T14:03:43","modified_gmt":"2009-08-30T06:03:43","slug":"rtorrent-and-selfsigned-ssl-certs","status":"publish","type":"post","link":"http:\/\/blog.depannone.com\/?p=148","title":{"rendered":"rTorrent and selfsigned SSL certs"},"content":{"rendered":"<p>Here is a little tutorial for using rTorrent on sites using self signed SSL certs that I wrote today.  <\/p>\n<p>I have taken bits a pieces from various sites around the place.<\/p>\n<p>Broadly speaking the process to get rTorrent working using a self signed cert are these:-<\/p>\n<p>1.  Get the cert and convert to a format rTorrent can use<br \/>\n2.  Put the cert somewhere you will be able to find<br \/>\n3.  Change rTorrents config to ensure it knows where to find the SSL certs<\/p>\n<p>So, here we go.<\/p>\n<p>1.  ==Get the cert==<br \/>\nLog into your linux box as the user that will be running rTorrent and change to you home<br \/>\ndirectory. <\/p>\n<p>Pass the following command&#8230;&#8230;<\/p>\n<p>sudo openssl s_client -connect thesitenamehere.com:443 | tee out_cert<\/p>\n<p>You will see the SSL certificate on your screen, now hit CTRL-C, magically in the directory<br \/>\nyou are now in will be a file called out_cert.  Now you need to convert the cert to x509<br \/>\n format.  To do this pass the following command<\/p>\n<p>sudo openssl x509 -inform PEM -in out_cert -text -out out.pem<\/p>\n<p>You can view the files we created with a text editor if you so wish.<\/p>\n<p>2.  ==Put the cert in a know directory==<br \/>\nNow you need to find out where your QNAP\/NAS\/PC has all the SSL certificates, they could be<br \/>\nin \/etc\/ssl\/certs, take a look.  If not you need to find out where they are.  Once you<br \/>\nhave found where they are copy the out.pem file to the directory where the SSL certs are<br \/>\nlets pretend they are in \/etc\/ssl\/certs.  Pass the following command&#8230;<\/p>\n<p>sudo cp out.pem \/etc\/ssl\/certs<\/p>\n<p>Then once it is in that directory change to the \/etc\/ssl\/certs directory.  Once you are in<br \/>\nthere pass the following command&#8230;.<\/p>\n<p>sudo c_rehash<\/p>\n<p>3.  ==The ~rtorrent.rc==<br \/>\nNow you need to find the example ~rtorrent.rc file that comes with rTorrent (note<br \/>\nthat it is a hidden file as it starts with &#8216;~&#8217;).<br \/>\nOnce found copy it to the home directory of the user that will be running rTorrent.  the name of the<br \/>\nfile should be ~rtorrent.rc<\/p>\n<p>Now go into the ~rtorrent.rc file and take a look at the options it gives you, this is the<br \/>\npower of rTorrent.  Use your favourite text editor, I use vi, there are plenty others.<\/p>\n<p>Anyway, now you need to put the following line at the bottom of the ~rtorrent.rc file<\/p>\n<p># directory for ssl certificates on self signed trackers<br \/>\nhttp_capath=\/etc\/ssl\/certs<\/p>\n<p>That should be it.  You should be able to connect to your site now and torrent away. <\/p>\n<p>You will need to change the rtorrent.rc file to ensure it works well with your QNAP\/NAS\/PC.  In particular you should alter it to include a watch directory for new .torrent files so its starts automatically downloading, and also perhaps a default save directory etc.<\/p>\n<p>Check out rtorrents site and also read some of the tutorials out there&#8230;&#8230;<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"wKrVx9WLBW\"><p><a href=\"https:\/\/kmandla.wordpress.com\/2007\/05\/02\/howto-use-rtorrent-like-a-pro\/\">Howto: Use rtorrent like a&nbsp;pro<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Howto: Use rtorrent like a&nbsp;pro&#8221; &#8212; Motho ke motho ka botho\" src=\"https:\/\/kmandla.wordpress.com\/2007\/05\/02\/howto-use-rtorrent-like-a-pro\/embed\/#?secret=7xRy6BfJu3#?secret=wKrVx9WLBW\" data-secret=\"wKrVx9WLBW\" width=\"525\" height=\"296\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><br \/>\nhttp:\/\/libtorrent.rakshasa.no\/<\/p>\n<p>Enjoy rTorrent, its the shitzen.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is a little tutorial for using rTorrent on sites using self signed SSL certs that I wrote today. I have taken bits a pieces from various sites around the place. Broadly speaking the process to get rTorrent working using a self signed cert are these:- 1. Get the cert and convert to a format &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/blog.depannone.com\/?p=148\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;rTorrent and selfsigned SSL certs&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6,7],"tags":[19,36,41],"class_list":["post-148","post","type-post","status-publish","format-standard","hentry","category-torrent","category-geek_stuff","category-linux","tag-dns-323","tag-rtorrent","tag-torrents"],"_links":{"self":[{"href":"http:\/\/blog.depannone.com\/index.php?rest_route=\/wp\/v2\/posts\/148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.depannone.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.depannone.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.depannone.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.depannone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=148"}],"version-history":[{"count":0,"href":"http:\/\/blog.depannone.com\/index.php?rest_route=\/wp\/v2\/posts\/148\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.depannone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.depannone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=148"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.depannone.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}