{"id":339,"date":"2016-08-08T10:24:00","date_gmt":"2016-08-08T10:24:00","guid":{"rendered":""},"modified":"2019-07-03T13:17:30","modified_gmt":"2019-07-03T13:17:30","slug":"stunnel-a-proxy-to-ship-the-log-on-ssl","status":"publish","type":"post","link":"https:\/\/opstree.com\/blog\/2016\/08\/08\/stunnel-a-proxy-to-ship-the-log-on-ssl\/","title":{"rendered":"Stunnel a Proxy to ship the log on SSL"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align:left;\">\n<div style=\"text-align:justify;\">\n<h2><b>Introduction<\/b><\/h2>\n<\/div>\n<p style=\"text-align:justify;\">p { margin-bottom: 0.25cm; line-height: 120%; }a:link { }<\/p>\n<p>Few days ago I got a task to create the SSL connection with logstash redis plug-in with Azure Redis. As we are shipping the logs form the several data center to the Azure Redis. So logs must be shipped on SSL connection. There is no provision to create SSL connection through logstash redis plug-in thats why logstash redis plug-in is not able to make <span style=\"line-height:100%;\">SSL<\/span><span style=\"line-height:100%;\">&nbsp;connection with Azure redis.<\/span>To resolve this problem we have to setup the stunnel as proxy front of the logstash redis plug-in. Stunnel can create SSL connection with Azure redis and Stunnel provide non-ssl connection for the logstash redis plug-in.<\/p>\n<div class=\"separator\" style=\"clear:both;text-align:center;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2016\/08\/0e51f-stunnel2b-2bnew2bpage2b252812529.jpeg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2016\/08\/0e51f-stunnel2b-2bnew2bpage2b252812529.jpeg?w=300\" width=\"400\" height=\"245\" border=\"0\"><\/a><\/div>\n<p>p { margin-bottom: 0.25cm; line-height: 120%; }a:link { Azure redis provide two type of connections, SSL on 6380 port and non SSL on 6379&nbsp;<span style=\"line-height:100%;\">port<\/span><span style=\"line-height:100%;\">&nbsp;and also provide primary and secondary key(password).<\/span><\/p>\n<\/div>\n<h2 style=\"text-align:left;\"><b>Installation<\/b><\/h2>\n<div style=\"line-height:100%;margin-bottom:0;text-align:justify;\"><\/div>\n<p>Install Stunnel on the ubuntu.<\/p>\n<div style=\"line-height:100%;margin-bottom:0;text-align:justify;\"><\/div>\n<div style=\"line-height:100%;margin-bottom:0;text-align:justify;\">\n<pre style=\"background-color:#eeeeee;border:1px dashed #999999;color:black;font-family:Andale Mono, Lucida Console, Monaco, fixed, monospace;font-size:12px;line-height:14px;overflow:auto;padding:5px;width:100%;\"><code style=\"color:black;word-wrap:normal;\">$ sudo apt-get install stunnel&nbsp; <\/code><\/pre>\n<\/div>\n<h2 style=\"text-align:justify;\"><b>Configuration<\/b><\/h2>\n<p>Create a configuration for stunnel \/etc\/stunnel\/stunnel.conf and put the following lines into the configure file.<\/p>\n<p dir=\"ltr\" style=\"text-align:left;\">\n<p><code style=\"color:black;word-wrap:normal;\">setuid = root<br \/>\nsetgid = root<br \/>\npid = \/var\/run\/stunnel-azureredis.pid<br \/>\ndebug = 7<br \/>\noutput = \/var\/log\/stunnel4\/azureredis.log<br \/>\noptions = NO_SSLv2<br \/>\noptions = NO_SSLv3<br \/>\n[azureredis]<br \/>\naccept=127.0.0.1:6379<br \/>\nconnect=:6380<br \/>\nclient=yes<br \/>\nTimeout idle = 30 <\/code><\/p>\n<p>p { margin-bottom: 0.25cm; line-height: 120%; }a:link { }<\/p>\n<div style=\"line-height:100%;margin-bottom:0;\">Restart the stunnel4<\/div>\n<div><\/div>\n<div style=\"line-height:100%;margin-bottom:0;\">p { margin-bottom: 0.25cm; line-height: 120%; }a:link { }<\/div>\n<div><\/div>\n<div><\/div>\n<div style=\"line-height:100%;margin-bottom:0;\">\n<pre style=\"background-color:#eeeeee;border:1px dashed #999999;color:black;font-family:Andale Mono, Lucida Console, Monaco, fixed, monospace;font-size:12px;line-height:14px;overflow:auto;padding:5px;width:100%;\"><code style=\"color:black;word-wrap:normal;\">$ service stunnel4 restart<\/code><\/pre>\n<\/div>\n<p style=\"line-height:100%;margin-bottom:0;\">Install Redis-cli to test the connection try to ping the redis azure it should reply as PONG<\/p>\n<p style=\"line-height:100%;margin-bottom:0;\"><code style=\"color:black;word-wrap:normal;\">$ redis-cli -a<br \/>\n127.0.0.1:6379&gt; ping<br \/>\nPONG<br \/>\n<\/code><\/p>\n<p>Now you can make SSL connection with azure redis on SSL.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction p { margin-bottom: 0.25cm; line-height: 120%; }a:link { } Few days ago I got a task to create the SSL connection with logstash redis plug-in with Azure Redis. As we are shipping the logs form the several data center to the Azure Redis. So logs must be shipped on SSL connection. There is no &hellip; <a href=\"https:\/\/opstree.com\/blog\/2016\/08\/08\/stunnel-a-proxy-to-ship-the-log-on-ssl\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Stunnel a Proxy to ship the log on SSL&#8221;<\/span><\/a><\/p>\n","protected":false},"author":150552946,"featured_media":29900,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[1],"tags":[12657,58302,1359381],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2025\/11\/DevSecOps-1.jpg","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pfDBOm-5t","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/339"}],"collection":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/users\/150552946"}],"replies":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/comments?post=339"}],"version-history":[{"count":6,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/339\/revisions"}],"predecessor-version":[{"id":683,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/339\/revisions\/683"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media\/29900"}],"wp:attachment":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media?parent=339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/categories?post=339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/tags?post=339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}