stunnel.conf 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. ; Sample stunnel configuration file for Unix by Michal Trojnara 2002-2015
  2. ; Some options used here may be inadequate for your particular configuration
  3. ; This sample file does *not* represent stunnel.conf defaults
  4. ; Please consult the manual for detailed description of available options
  5. ; **************************************************************************
  6. ; * Global options *
  7. ; **************************************************************************
  8. ; It is recommended to drop root privileges if stunnel is started by root
  9. ;setuid = stunnel4
  10. ;setgid = stunnel4
  11. ; PID file is created inside the chroot jail (if enabled)
  12. pid = /var/run/stunnel4/stunnel.pid
  13. ; Debugging stuff (may be useful for troubleshooting)
  14. ;foreground = yes
  15. ;debug = info
  16. output = /var/log/stunnel4/stunnel.log
  17. ; Enable FIPS 140-2 mode if needed for compliance
  18. ;fips = yes
  19. fips = no
  20. ; **************************************************************************
  21. ; * Service defaults may also be specified in individual service sections *
  22. ; **************************************************************************
  23. ; Enable support for the insecure SSLv3 protocol
  24. options = -NO_SSLv3
  25. sslVersion = TLSv1.2
  26. ; These options provide additional security at some performance degradation
  27. ;options = SINGLE_ECDH_USE
  28. ;options = SINGLE_DH_USE
  29. ; **************************************************************************
  30. ; * Include all configuration file fragments from the specified folder *
  31. ; **************************************************************************
  32. ;include = /etc/stunnel/conf.d
  33. ; **************************************************************************
  34. ; * Service definitions (remove all services for inetd mode) *
  35. ; **************************************************************************
  36. ; ***************************************** Example TLS client mode services
  37. ; The following examples use /etc/ssl/certs, which is the common location
  38. ; of a hashed directory containing trusted CA certificates. This is not
  39. ; a hardcoded path of the stunnel package, as it is not related to the
  40. ; stunnel configuration in /etc/stunnel/.
  41. ;[mydomen-pop3]
  42. ;client = yes
  43. ;accept = 127.0.0.1:110
  44. ;connect = pop3.mydomen.ru:995
  45. ;verifyChain = yes
  46. ;CApath = @sysconfdir/ssl/certs
  47. ;checkHost = pop3s.mydomen.ru
  48. ;OCSPaia = yes
  49. ;[mydomen-imap]
  50. ;client = yes
  51. ;accept = 127.0.0.1:143
  52. ;connect = imap.mydomen.ru:993
  53. ;verifyChain = yes
  54. ;CApath = @sysconfdir/ssl/certs
  55. ;checkHost = imaps.mydomen.ru
  56. ;OCSPaia = yes
  57. ;[mydomen-smtp]
  58. ;client = yes
  59. ;accept = 127.0.0.1:25
  60. ;connect = smtp.mydomen.ru:465
  61. ;verifyChain = yes
  62. ;CApath = @sysconfdir/ssl/certs
  63. ;checkHost = smtps.mydomen.ru
  64. ;OCSPaia = yes
  65. ; ***************************************** Example TLS server mode services
  66. [pop3s]
  67. accept = 10.2.2.8:995
  68. connect = 10.2.2.8:110
  69. cert=/etc/letsencrypt/live/mail.mydomen.ru/fullchain.pem
  70. key=/etc/letsencrypt/live/mail.mydomen.ru/privkey.pem
  71. [imaps]
  72. accept = 10.2.2.8:993
  73. connect = 10.2.2.8:143
  74. cert=/etc/letsencrypt/live/mail.mydomen.ru/fullchain.pem
  75. key=/etc/letsencrypt/live/mail.mydomen.ru/privkey.pem
  76. [smtps]
  77. accept = 10.2.2.8:465
  78. connect = 10.2.2.8:587
  79. cert=/etc/letsencrypt/live/mail.mydomen.ru/fullchain.pem
  80. key=/etc/letsencrypt/live/mail.mydomen.ru/privkey.pem
  81. ; TLS front-end to a web server
  82. ;[https]
  83. ;accept = 443
  84. ;connect = 80
  85. ;cert = /etc/stunnel/stunnel.pem
  86. ; "TIMEOUTclose = 0" is a workaround for a design flaw in Microsoft SChannel
  87. ; Microsoft implementations do not use TLS close-notify alert and thus they
  88. ; are vulnerable to truncation attacks
  89. ;TIMEOUTclose = 0
  90. ; Remote shell protected with PSK-authenticated TLS
  91. ; Create "/etc/stunnel/secrets.txt" containing IDENTITY:KEY pairs
  92. ;[shell]
  93. ;accept = 1337
  94. ;exec = /bin/sh
  95. ;execArgs = sh -i
  96. ;ciphers = PSK
  97. ;PSKsecrets = /etc/stunnel/secrets.txt
  98. ; Non-standard MySQL-over-TLS encapsulation connecting the Unix socket
  99. ;[mysql]
  100. ;cert = /etc/stunnel/stunnel.pem
  101. ;accept = 3307
  102. ;connect = /run/mysqld/mysqld.sock
  103. ; vim:ft=dosini