I need to create a secure tunnel from my server to the torsite.onion:port. As an example when I connect to myserver at myserver:port it will redirect to the tormailxxxxx.onion:25 for the tor email service. I hope this solution will be really easy to do, but so far I couldn't find any sufficient solution. Thank you in advance

1 Answer 1


You need a Stunnel with full verification enabled (verify=3 in config) and your local SSL microCA. For microCA I do recommend you to try either an OpenSSL perl scripts, or easyRSA as something more advanced.

  • Thanks Alexey for that stunnel part, but what about the way how to establish a connection itself ? Ssh/Stunnel probably can't resolve .onion adress itself. Thank you.
    – J Doe
    Commented Apr 25, 2016 at 5:52
  • they won;t need to : as soon as you will connect through them via Internet/clearnet - they will just forward the traffic to localhost as they always can do. After that Tor plays it's role and makes a darknet part of the tunnel.
    – Alexey Vesnin
    Commented Apr 25, 2016 at 14:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .