stunnel-5.74/0000755000175000001440000000000014727063631006707 5stunnel-5.74/NEWS.md0000644000175000001440000030617314727062526007741 # stunnel change log ### Version 5.74, 2024.12.13, urgency: HIGH * Bugfixes - Fixed a stapling cache deallocation crash. - Fixed "redirect" with protocol negotiation. * Features - "protocolHost" support for "socks" protocol clients. - More detailed logs in OpenSSL 3.0 or later. ### Version 5.73, 2024.09.09, urgency: MEDIUM * Security bugfixes - OpenSSL DLLs updated to version 3.3.2. - OpenSSL FIPS Provider updated to version 3.0.9. * Bugfixes - Fixed a memory leak while reloading stunnel.conf sections with "client=yes" and "delay=no". - Fixed TIMEOUTocsp with values greater than 4. - Fix the IPv6 test on a non-IPv6 machine. * Features - HELO replaced with EHLO in the post-STARTTLS SMTP protocol negotiation (thx to Peter Pentchev). - OCSP stapling fetches moved away from server threads. - Improved client-side session resumption. - Added support for the mimalloc allocator. - Check for protocolHost moved to configuration file processing for the client-side CONNECT protocol. - Clarified some confusing OpenSSL's certificate verification error messages. - stunnel.nsi updated for Debian 13 and Fedora. - Improved NetBSD compatibility. ### Version 5.72, 2024.02.04, urgency: MEDIUM * Security bugfixes - OpenSSL DLLs updated to version 3.2.1. * Bugfixes - Fixed SSL_CTX_new() errors handling. - Fixed OPENSSL_NO_PSK builds. - Android build updated for NDK r23c. - stunnel.nsi updated for Debian 12. - Fixed tests with OpenSSL older than 1.0.2. ### Version 5.71, 2023.09.19, urgency: MEDIUM * Security bugfixes - OpenSSL DLLs updated to version 3.1.3. * Bugfixes - Fixed the console output of tstunnel.exe. * Features sponsored by SAE IT-systems - OCSP stapling is requested and verified in the client mode. - Using "verifyChain" automatically enables OCSP stapling in the client mode. - OCSP stapling is always available in the server mode. - An inconclusive OCSP verification breaks TLS negotiation. This can be disabled with "OCSPrequire = no". - Added the "TIMEOUTocsp" option to control the maximum time allowed for connecting an OCSP responder. * Features - Added support for Red Hat OpenSSL 3.x patches. ### Version 5.70, 2023.07.12, urgency: HIGH * Security bugfixes - OpenSSL DLLs updated to version 3.0.9. - OpenSSL FIPS Provider updated to version 3.0.8. * Bugfixes - Fixed TLS socket EOF handling with OpenSSL 3.x. This bug caused major interoperability issues between stunnel built with OpenSSL 3.x and Microsoft's Schannel Security Support Provider (SSP). - Fixed reading certificate chains from PKCS#12 files. * Features - Added configurable delay for the "retry" option. ### Version 5.69, 2023.03.04, urgency: MEDIUM * New features - Improved logging performance with the "output" option. - Improved file read performance on the WIN32 platform. - DH and kDHEPSK ciphersuites removed from FIPS defaults. - Set the LimitNOFILE ulimit in stunnel.service to allow for up to 10,000 concurrent clients. * Bugfixes - Fixed the "CApath" option on the WIN32 platform by applying https://github.com/openssl/openssl/pull/20312. - Fixed stunnel.spec used for building rpm packages. - Fixed tests on some OSes and architectures by merging Debian 07-tests-errmsg.patch (thx to Peter Pentchev). ### Version 5.68, 2023.02.07, urgency: HIGH * Security bugfixes - OpenSSL DLLs updated to version 3.0.8. * New features - Added the new 'CAengine' service-level option to load a trusted CA certificate from an engine. - Added requesting client certificates in server mode with 'CApath' besides 'CAfile'. - Improved file read performance. - Improved logging performance. * Bugfixes - Fixed EWOULDBLOCK errors in protocol negotiation. - Fixed handling TLS errors in protocol negotiation. - Prevented following fatal TLS alerts with TCP resets. - Improved OpenSSL initialization on WIN32. - Improved testing suite stability. ### Version 5.67, 2022.11.01, urgency: HIGH * Security bugfixes - OpenSSL DLLs updated to version 3.0.7. * New features - Provided a logging callback to custom engines. * Bugfixes - Fixed "make cert" with OpenSSL older than 3.0. - Fixed the code and the documentation to use conscious language for SNI servers (thx to Clemens Lang). ### Version 5.66, 2022.09.11, urgency: MEDIUM * New features - OpenSSL 3.0 FIPS Provider support for Windows. * Bugfixes - Fixed building on machines without pkg-config. - Added the missing "environ" declaration for BSD-based operating systems. - Fixed the passphrase dialog with OpenSSL 3.0. ### Version 5.65, 2022.07.17, urgency: HIGH * Security bugfixes - OpenSSL DLLs updated to version 3.0.5. * Bugfixes - Fixed handling globally enabled FIPS. - Fixed openssl.cnf processing in WIN32 GUI. - Fixed a number of compiler warnings. - Fixed tests on older versions of OpenSSL. ### Version 5.64, 2022.05.06, urgency: MEDIUM * Security bugfixes - OpenSSL DLLs updated to version 3.0.3. * New features - Updated the pkcs11 engine for Windows. * Bugfixes - Removed the SERVICE_INTERACTIVE_PROCESS flag in "stunnel -install". ### Version 5.63, 2022.03.15, urgency: HIGH * Security bugfixes - OpenSSL DLLs updated to version 3.0.2. * New features - Updated stunnel.spec to support bash completion. * Bugfixes - Fixed a PRNG initialization crash (thx to Gleydson Soares). ### Version 5.62, 2022.01.17, urgency: MEDIUM * New features - Added a bash completion script. * Bugfixes - Fixed a transfer() loop bug. ### Version 5.61, 2021.12.22, urgency: LOW * New features sponsored by the University of Maryland - Added new "protocol = capwin" and "protocol = capwinctrl" configuration file options. * New features for the Windows platform - Added client mode allowing authenticated users to view logs, reconfigure and terminate running stunnel services. - Added support for multiple GUI and service instances distinguised by the location of stunnel.conf. - Improved log window scrolling. - Added a new 'Pause auto-scroll' GUI checkbox. - Double click on the icon tray replaced with single click. - OpenSSL DLLs updated to version 3.0.1. * Other new features - Rewritten the testing framework in python (thx to Peter Pentchev for inspiration and initial framework). - Added support for missing SSL_set_options() values. - Updated stunnel.spec to support RHEL8. * Bugfixes - Fixed OpenSSL 3.0 build. - Fixed reloading configuration with "systemctl reload stunnel.service". - Fixed incorrect messages logged for OpenSSL errors. - Fixed printing IPv6 socket option defaults on FreeBSD. ### Version 5.60, 2021.08.16, urgency: LOW * New features - New 'sessionResume' service-level option to allow or disallow session resumption - Added support for the new SSL_set_options() values. - Download fresh ca-certs.pem for each new release. * Bugfixes - Fixed 'redirect' with 'protocol'. This combination is not supported by 'smtp', 'pop3' and 'imap' protocols. - Enforced minimum WIN32 log window size. - Fixed support for password-protected private keys with OpenSSL 3.0 (thx to Dmitry Belyavskiy). ### Version 5.59, 2021.04.05, urgency: HIGH * Security bugfixes - OpenSSL DLLs updated to version 1.1.1k. * New features - Client-side "protocol = ldap" support (thx to Bart Dopheide and Seth Grover). * Bugfixes - The test suite fixed not to require external connectivity. - Fixed paths in generated manuals (thx to Tatsuki Makino). - Fixed configuration reload when compression is used. - Fixed compilation with early releases of OpenSSL 1.1.1. ### Version 5.58, 2021.02.20, urgency: HIGH * Security bugfixes - The "redirect" option was fixed to properly handle unauthenticated requests (thx to Martin Stein). - Fixed a double free with OpenSSL older than 1.1.0 (thx to Petr Strukov). - OpenSSL DLLs updated to version 1.1.1j. * New features - New 'protocolHeader' service-level option to insert custom 'connect' protocol negotiation headers. This feature can be used to impersonate other software (e.g. web browsers). - 'protocolHost' can also be used to control the client SMTP protocol negotiation HELO/EHLO value. - Initial FIPS 3.0 support. * Bugfixes - X.509v3 extensions required by modern versions of OpenSSL are added to generated self-signed test certificates. - Fixed a tiny memory leak in configuration file reload error handling (thx to Richard Könning). - Merged Debian 05-typos.patch (thx to Peter Pentchev). - Merged with minor changes Debian 06-hup-separate.patch (thx to Peter Pentchev). - Merged Debian 07-imap-capabilities.patch (thx to Ansgar). - Merged Debian 08-addrconfig-workaround.patch (thx to Peter Pentchev). - Fixed tests on the WSL2 platform. - NSIS installer updated to version 3.06 to fix a multiuser installation bug on some platforms, including 64-bit XP. - Fixed engine initialization (thx to Petr Strukov). - FIPS TLS feature is reported when a provider or container is available, and not when FIPS control API is available. ### Version 5.57, 2020.10.11, urgency: HIGH * Security bugfixes - The "redirect" option was fixed to properly handle "verifyChain = yes" (thx to Rob Hoes). - OpenSSL DLLs updated to version 1.1.1h. * New features - New securityLevel configuration file option. - FIPS support for RHEL-based distributions. - Support for modern PostgreSQL clients (thx to Bram Geron). - Windows tooltip texts updated to mention "stunnel". - TLS 1.3 configuration updated for better compatibility. * Bugfixes - Fixed a transfer() loop bug. - Fixed memory leaks on configuration reloading errors. - DH/ECDH initialization restored for client sections. - Delay startup with systemd until network is online. - bin\libssp-0.dll removed when uninstalling. - A number of testing framework fixes and improvements. ### Version 5.56, 2019.11.22, urgency: HIGH * New features - Various text files converted to Markdown format. * Bugfixes - Support for realpath(3) implementations incompatible with POSIX.1-2008, such as 4.4BSD or Solaris. - Support for engines without PRNG seeding methods (thx to Petr Mikhalitsyn). - Retry unsuccessful port binding on configuration file reload. - Thread safety fixes in SSL_SESSION object handling. - Terminate clients on exit in the FORK threading model. ### Version 5.55, 2019.06.10, urgency: HIGH * Security bugfixes - Fixed a Windows local privilege escalation vulnerability caused insecure OpenSSL cross-compilation defaults. Successful exploitation requires stunnel to be deployed as a Windows service, and user-writable C:\ folder. This vulnerability was discovered and reported by Rich Mirch. - OpenSSL DLLs updated to version 1.1.1c. * Bugfixes - Implemented a workaround for Windows hangs caused by its inability to the monitor the same socket descriptor from multiple threads. - Windows configuration (including cryptographic keys) is now completely removed at uninstall. - A number of testing framework fixes and improvements. ### Version 5.54, 2019.05.15, urgency: LOW * New features - New "ticketKeySecret" and "ticketMacSecret" options to control confidentiality and integrity protection of the issued session tickets. These options allow for session resumption on other nodes in a cluster. - Added logging the list of active connections on SIGUSR2 or with Windows GUI. - Logging of the assigned bind address instead of the requested bind address. * Bugfixes - Service threads are terminated before OpenSSL cleanup to prevent occasional stunnel crashes at shutdown. ### Version 5.53, 2019.04.10, urgency: HIGH * New features - Android binary updated to support Android 4.x. * Bugfixes - Fixed data transfer stalls introduced in stunnel 5.51. ### Version 5.52, 2019.04.08, urgency: HIGH * Bugfixes - Fixed a transfer() loop bug introduced in stunnel 5.51. ### Version 5.51, 2019.04.04, urgency: MEDIUM * New features - OpenSSL DLLs updated to version 1.1.1b. - Hexadecimal PSK keys are automatically converted to binary. - Session ticket support (requires OpenSSL 1.1.1 or later). "connect" address persistence is currently unsupported with session tickets. - SMTP HELO before authentication (thx to Jacopo Giudici). - New "curves" option to control the list of elliptic curves in OpenSSL 1.1.0 and later. - New "ciphersuites" option to control the list of permitted TLS 1.3 ciphersuites. - Include file name and line number in OpenSSL errors. - Compatibility with the current OpenSSL 3.0.0-dev branch. - Better performance with SSL_set_read_ahead()/SSL_pending(). * Bugfixes - Fixed PSKsecrets as a global option (thx to Teodor Robas). - Fixed a memory allocation bug (thx to matanfih). ### Version 5.50, 2018.12.02, urgency: MEDIUM * New features - 32-bit Windows builds replaced with 64-bit builds. - OpenSSL DLLs updated to version 1.1.1. - Check whether "output" is not a relative file name. - Added sslVersion, sslVersionMin and sslVersionMax for OpenSSL 1.1.0 and later. * Bugfixes - Fixed PSK session resumption with TLS 1.3. - Fixed a memory leak in the WIN32 logging subsystem. - Allow for zero value (ignored) TLS options. - Partially refactored configuration file parsing and logging subsystems for clearer code and minor bugfixes. * Caveats - We removed FIPS support from our standard builds. FIPS will still be available with custom builds. ### Version 5.49, 2018.09.03, urgency: MEDIUM * New features - Performance optimizations. - Logging of negotiated or resumed TLS session IDs (thx to ANSSI - National Cybersecurity Agency of France). - Merged Debian 10-enabled.patch and 11-killproc.patch (thx to Peter Pentchev). - OpenSSL DLLs updated to version 1.0.2p. - PKCS#11 engine DLL updated to version 0.4.9. * Bugfixes - Fixed a crash in the session persistence implementation. - Fixed syslog identifier after configuration file reload. - Fixed non-interactive "make check" invocations. - Fixed reloading syslog configuration. - stunnel.pem created with SHA-256 instead of SHA-1. - SHA-256 "make check" certificates. ### Version 5.48, 2018.07.02, urgency: HIGH * Security bugfixes - Fixed requesting client certificate when specified as a global option. * New features - Certificate subject checks modified to accept certificates if at least one of the specified checks matches. ### Version 5.47, 2018.06.23, urgency: HIGH * New features - Fast add_lock_callback for OpenSSL < 1.1.0. This largely improves performance on heavy load. - Automatic detection of Homebrew OpenSSL. - Clarified port binding error logs. - Various "make test" improvements. * Bugfixes - Fixed a crash on switching to SNI secondary sections. ### Version 5.46, 2018.05.28, urgency: MEDIUM * New features - The default cipher list was updated to a safer value: "HIGH:!aNULL:!SSLv2:!DH:!kDHEPSK". * Bugfixes - Default accept address restored to INADDR_ANY. ### Version 5.45, 2018.05.21, urgency: MEDIUM * New feature sponsored by https://loadbalancer.org/ - Implemented delayed deallocation of service sections after configuration file reload. * Other new features - OpenSSL DLLs updated to version 1.0.2o. - Deprecated the sslVersion option. - The "socket" option is now also available in service sections. - Implemented try-restart in the SysV init script (thx to Peter Pentchev). - TLS 1.3 compliant session handling for OpenSSL 1.1.1. - Default "failover" value changed from "rr" to "prio". - New "make check" tests. * Bugfixes - A service no longer refuses to start if binding fails for some (but not all) addresses:ports. - Fixed compression handling with OpenSSL 1.1.0 and later. - _beginthread() replaced with safer _beginthreadex(). - Fixed exception handling in libwrap. - Fixed exec+connect services. - Fixed automatic resolver delaying. - Fixed a Gentoo cross-compilation bug (thx to Joe Harvell). - A number of "make check" framework fixes. - Fixed false postive memory leak logs. - Build fixes for OpenSSL versions down to 0.9.7. - Fixed (again) round-robin failover in the FORK threading model. ### Version 5.44, 2017.11.26, urgency: MEDIUM * New features - Signed Win32 executables, libraries, and installer. * Bugfixes - Default accept address restored to INADDR_ANY. - Fixed a race condition in "make check". - Fixed removing the pid file after configuration reload. ### Version 5.43, 2017.11.05, urgency: LOW * New features - OpenSSL DLLs updated to version 1.0.2m. - Android build updated to OpenSSL 1.1.0g. - Allow for multiple "accept" ports per section. - Self-test framework (make check). - Added config load before OpenSSL init (thx to Dmitrii Pichulin). - OpenSSL 1.1.0 support for Travis CI. - OpenSSL 1.1.1-dev compilation fixes. * Bugfixes - Fixed a memory fault on Solaris. - Fixed round-robin failover in the FORK threading model. - Fixed handling SSL_ERROR_ZERO_RETURN in SSL_shutdown(). - Minor fixes of the logging subsystem. ### Version 5.42, 2017.07.16, urgency: HIGH * New features - "redirect" also supports "exec" and not only "connect". - PKCS#11 engine DLL updated to version 0.4.7. * Bugfixes - Fixed premature cron thread initialization causing hangs. - Fixed "verifyPeer = yes" on OpenSSL <= 1.0.1. - Fixed pthreads support on OpenSolaris. ### Version 5.41, 2017.04.01, urgency: MEDIUM * New features - PKCS#11 engine DLL updated to version 0.4.5. - Default engine UI set with ENGINE_CTRL_SET_USER_INTERFACE. - Key file name added into the passphrase console prompt. - Performance optimization in memory leak detection. * Bugfixes - Fixed crashes with the OpenSSL 1.1.0 branch. - Fixed certificate verification with "verifyPeer = yes" and "verifyChain = no" (the default), while the peer only returns a single certificate. ### Version 5.40, 2017.01.28, urgency: HIGH * Security bugfixes - OpenSSL DLLs updated to version 1.0.2k. https://www.openssl.org/news/secadv/20170126.txt * New features - DH ciphersuites are now disabled by default. - The daily server DH parameter regeneration is only performed if DH ciphersuites are enabled in the configuration file. - "checkHost" and "checkEmail" were modified to require either "verifyChain" or "verifyPeer" (thx to Małorzata Olszówka). * Bugfixes - Fixed setting default ciphers. ### Version 5.39, 2017.01.01, urgency: LOW * New features - PKCS#11 engine (pkcs11.dll) added to the Win32 build. - Per-destination TLS session cache added for the client mode. - The new "logId" parameter "process" added to log PID values. - Added support for the new SSL_set_options() values. - Updated the manual page. - Obsolete references to "SSL" replaced with "TLS". * Bugfixes - Fixed "logId" parameter to also work in inetd mode. - "delay = yes" properly enforces "failover = prio". - Fixed fd_set allocation size on Win64. - Fixed reloading invalid configuration file on Win32. - Fixed resolving addresses with unconfigured network interfaces. ### Version 5.38, 2016.11.26, urgency: MEDIUM * New features - "sni=" can be used to prevent sending the SNI extension. - The AI_ADDRCONFIG resolver flag is used when available. - Merged Debian 06-lfs.patch (thx to Peter Pentchev). * Bugfixes - Fixed a memory allocation bug causing crashes with OpenSSL 1.1.0. - Fixed error handling for mixed IPv4/IPv6 destinations. - Merged Debian 08-typos.patch (thx to Peter Pentchev). ### Version 5.37, 2016.11.06, urgency: MEDIUM * Bugfixes - OpenSSL DLLs updated to version 1.0.2j (stops crashes). - The default SNI target (not handled by any secondary service) is handled by the primary service rather than rejected. - Removed thread synchronization in the FORK threading model. ### Version 5.36, 2016.09.22, urgency: HIGH * Security bugfixes - OpenSSL DLLs updated to version 1.0.2i. https://www.openssl.org/news/secadv_20160922.txt * New features - Added support for OpenSSL 1.1.0 built with "no-deprecated". - Removed direct zlib dependency. ### Version 5.35, 2016.07.18, urgency: HIGH * Bugfixes - Fixed incorrectly enforced client certificate requests. - Only default to SO_EXCLUSIVEADDRUSE on Vista and later. - Fixed thread safety of the configuration file reopening. ### Version 5.34, 2016.07.05, urgency: HIGH * Security bugfixes - Fixed malfunctioning "verify = 4". * New features - Bind sockets with SO_EXCLUSIVEADDRUSE on WIN32. - Added three new service-level options: requireCert, verifyChain, and verifyPeer for fine-grained certificate verification control. - Improved compatibility with the current OpenSSL 1.1.0-dev tree. ### Version 5.33, 2016.06.23, urgency: HIGH * New features - Improved memory leak detection performance and accuracy. - Improved compatibility with the current OpenSSL 1.1.0-dev tree. - SNI support also enabled on OpenSSL 0.9.8f and later (thx to Guillermo Rodriguez Garcia). - Added support for PKCS #12 (.p12/.pfx) certificates (thx to Dmitry Bakshaev). * Bugfixes - Fixed a TLS session caching memory leak (thx to Richard Kraemer). Before stunnel 5.27 this leak only emerged with sessiond enabled. - Yet another WinCE socket fix (thx to Richard Kraemer). - Fixed passphrase/pin dialogs in tstunnel.exe. - Fixed a FORK threading build regression bug. - OPENSSL_NO_DH compilation fix (thx to Brian Lin). ### Version 5.32, 2016.05.03, urgency: HIGH * Security bugfixes - OpenSSL DLLs updated to version 1.0.2h. https://www.openssl.org/news/secadv_20160503.txt * New features - New "socket = a:IPV6_V6ONLY=yes" option to only bind IPv6. - Memory leak detection. - Improved compatibility with the current OpenSSL 1.1.0-dev tree. - Added/fixed Red Hat scripts (thx to Andrew Colin Kissa). * Bugfixes - Workaround for a WinCE sockets quirk (thx to Richard Kraemer). - Fixed data alignment on 64-bit MSVC (thx to Yuris W. Auzins). ### Version 5.31, 2016.03.01, urgency: HIGH * Security bugfixes - OpenSSL DLLs updated to version 1.0.2g. https://www.openssl.org/news/secadv_20160301.txt * New features - Added logging the list of client CAs requested by the server. - Improved compatibility with the current OpenSSL 1.1.0-dev tree. * Bugfixes - Only reset the watchdog if some data was actually transferred. - A workaround implemented for the unexpected exceptfds set by select() on WinCE 6.0 (thx to Richard Kraemer). - Fixed logging an incorrect value of the round-robin starting point (thx to Jose Alf.). ### Version 5.30, 2016.01.28, urgency: HIGH * Security bugfixes - OpenSSL DLLs updated to version 1.0.2f. https://www.openssl.org/news/secadv_20160128.txt * New features - Improved compatibility with the current OpenSSL 1.1.0-dev tree. - Added OpenSSL autodetection for the recent versions of Xcode. * Bugfixes - Fixed references to /etc removed from stunnel.init.in. - Stopped even trying -fstack-protector on unsupported platforms (thx to Rob Lockhart). ### Version 5.29, 2016.01.08, urgency: LOW * New features - New WIN32 icons. - Performance improvement: rwlocks used for locking with pthreads. * Bugfixes - Compilation fix for *BSD. - Fixed configuration file reload for relative stunnel.conf path on Unix. - Fixed ignoring CRLfile unless CAfile was also specified (thx to Strukov Petr). ### Version 5.28, 2015.12.11, urgency: HIGH * New features - Build matrix (.travis.yml) extended with ./configure options. - mingw.mak updated to build tstunnel.exe (thx to Jose Alf.). * Bugfixes - Fixed incomplete initialization. - Fixed UCONTEXT threading on OSX. - Fixed exit codes for information requests (as in "stunnel -version" or "stunnel -help"). ### Version 5.27, 2015.12.03, urgency: MEDIUM * Security bugfixes - OpenSSL DLLs updated to version 1.0.2e. https://www.openssl.org/news/secadv_20151203.txt * New features - Automated build testing configured with .travis.yml. - Added reading server certificates from hardware engines. For example: cert = id_45 - Only attempt to use potentially harmful compiler or linker options if gcc was detected. - /opt/csw added to the OpenSSL directory lookup list. - mingw.mak updates (thx to Jose Alf.). - TODO list updated. ### Version 5.26, 2015.11.06, urgency: MEDIUM * Bugfixes - Compilation fixes for OSX, *BSD and Solaris. ### Version 5.25, 2015.11.02, urgency: MEDIUM * New features - SMTP client protocol negotiation support for "protocolUsername", "protocolPassword", and "protocolAuthentication" (thx to Douglas Harris). - New service-level option "config" to specify configuration commands introduced in OpenSSL 1.0.2 (thx to Stephen Wall). - The global option "foreground" now also accepts "quiet" parameter, which does not enable logging to stderr. - Manual page updated. - Obsolete OpenSSL engines removed from the Windows build: 4758cca, aep, atalla, cswift, nuron, sureware. - Improved compatibility with the current OpenSSL 1.1.0-dev tree: gracefully handle symbols renamed from SSLeay* to OpenSSL*. * Bugfixes - Fixed the "s_poll_wait returned 1, but no descriptor is ready" internal error. - Fixed "exec" hangs due to incorrect thread-local storage handling (thx to Philip Craig). - Fixed PRNG initialization (thx to Philip Craig). - Setting socket options no longer performed on PTYs. - Fixed 64-bit Windows build. ### Version 5.24, 2015.10.08, urgency: MEDIUM * New features - Custom CRL verification was replaced with the internal OpenSSL functionality. - *BSD support for "transparent = destination" and client-side "protocol = socks". This feature should work at least on FreeBSD, OpenBSD and OS X. - Added a new "protocolDomain" option for the NTLM authentication (thx to Andreas Botsikas). - Improved compatibility of the NTLM phase 1 message (thx to Andreas Botsikas). - "setuid" and "setgid" options are now also available in service sections. They can be used to set owner and group of the Unix socket specified with "accept". - Added support for the new OpenSSL 1.0.2 SSL options. - Added OPENSSL_NO_EGD support (thx to Bernard Spil). - VC autodetection added to makew32.bat (thx to Andreas Botsikas). * Bugfixes - Fixed the RESOLVE [F0] TOR extension support in SOCKS5. - Fixed the error code reported on the failed bind() requests. - Fixed the sequential log id with the FORK threading. - Restored the missing Microsoft.VC90.CRT.manifest file. ### Version 5.23, 2015.09.02, urgency: LOW * New features - Client-side support for the SOCKS protocol. See https://www.stunnel.org/socksvpn.html for details. - Reject SOCKS requests to connect loopback addresses. - New service-level option "OCSPnonce". The default value is "OCSPnonce = no". - Win32 directory structure rearranged. The installer script provides automatic migration for common setups. - Added Win32 installer option to install stunnel for the current user only. This feature does not deploy the NT service, but it also does not require aministrative privileges to install and configure stunnel. - stunnel.cnf was renamed to openssl.cnf in order to to prevent users from mixing it up with stunnel.conf. - Win32 desktop is automatically refreshed when the icon is created or removed. - The ca-certs.pem file is now updated on stunnel upgrade. - Inactive ports were removed from the PORTS file. - Added IPv6 support to the transparent proxy code. * Bugfixes - Compilation fix for OpenSSL version older than 1.0.0. - Compilation fix for mingw. ### Version 5.22, 2015.07.30, urgency: HIGH * New features - "OCSPaia = yes" added to the configuration file templates. - Improved double free detection. * Bugfixes - Fixed a number of OCSP bugs. The most severe of those bugs caused stunnel to treat OCSP responses that failed OCSP_basic_verify() checks as if they were successful. - Fixed the passive IPv6 resolver (broken in stunnel 5.21). ### Version 5.21, 2015.07.27, urgency: MEDIUM * New features - Signal names are displayed instead of numbers. - First resolve IPv4 addresses on passive resolver requests. This speeds up stunnel startup on Win32 with a slow/defunct DNS service. - The "make check" target was modified to only build Win32 executables when stunnel is built from a git repository (thx to Peter Pentchev). - More elaborate descriptions were added to the warning about using "verify = 2" without "checkHost" or "checkIP". - Performance optimization was performed on the debug code. * Bugfixes - Fixed the FORK and UCONTEXT threading support. - Fixed "failover=prio" (broken since stunnel 5.15). - Added a retry when sleep(3) was interrupted by a signal in the cron thread scheduler. ### Version 5.20, 2015.07.09, urgency: HIGH * Security bugfixes - OpenSSL DLLs updated to version 1.0.2d. https://www.openssl.org/news/secadv_20150709.txt * New features - poll(2) re-enabled on MacOS X 10.5 and later. - Xcode SDK is automatically used on MacOS X if no other locally installed OpenSSL directory is found. - The SSL library detection algorithm was made a bit smarter. - Warnings about insecure authentication were modified to include the name of the affected service section. - A warning was added to stunnel.init if no pid file was specified in the configuration file (thx to Peter Pentchev). - Optional debugging symbols are included in the Win32 installer. - Documentation updates (closes Debian bug #781669). * Bugfixes - Signal pipe reinitialization added to prevent turning the main accepting thread into a busy wait loop when an external condition breaks the signal pipe. This bug was found to surface on Win32, but other platforms may also be affected. - Fixed removing the disabled taskbar icon. - Generated temporary DH parameters are used for configuration reload instead of the static defaults. - LSB compatibility fixes added to the stunnel.init script (thx to Peter Pentchev). - Fixed the manual page headers (thx to Gleydson Soares). ### Version 5.19, 2015.06.16, urgency: MEDIUM * New features - OpenSSL DLLs updated to version 1.0.2c. - Added a runtime check whether COMP_zlib() method is implemented in order to improve compatibility with the Debian OpenSSL build. * Bugfixes - Improved socket error handling. - Cron thread priority on Win32 platform changed to THREAD_PRIORITY_LOWEST to improve portability. - Makefile bugfixes for stunnel 5.18 regressions. - Fixed some typos in docs and scripts (thx to Peter Pentchev). - Fixed a log level check condition (thx to Peter Pentchev). ### Version 5.18, 2015.06.12, urgency: MEDIUM * New features - OpenSSL DLLs updated to version 1.0.2b. https://www.openssl.org/news/secadv_20150611.txt - Added "include" configuration file option to include all configuration file parts located in a specified directory. - Log file is reopened every 24 hours. With "log = overwrite" this feature can be used to prevent filling up disk space. - Temporary DH parameters are refreshed every 24 hours, unless static DH parameters were provided in the certificate file. - Unique initial DH parameters are distributed with each release. - Warnings are logged on potentially insecure authentication. - Improved compatibility with the current OpenSSL 1.1.0-dev tree: removed RLE compression support, etc. - Updated stunnel.spec (thx to Bill Quayle). * Bugfixes - Fixed handling of dynamic connect targets. - Fixed handling of trailing whitespaces in the Content-Length header of the NTLM authentication. - Fixed --sysconfdir and --localstatedir handling (thx to Dagobert Michelsen). ### Version 5.17, 2015.04.29, urgency: HIGH * Bugfixes - Fixed a NULL pointer dereference causing the service to crash. This bug was introduced in stunnel 5.15. ### Version 5.16, 2015.04.19, urgency: MEDIUM * Bugfixes - Fixed compilation with old versions of gcc. ### Version 5.15, 2015.04.16, urgency: LOW * New features - Added new service-level options "checkHost", "checkEmail" and "checkIP" for additional checks of the peer certificate subject. These options require OpenSSL version 1.0.2 or higher. - Win32 binary distribution now ships with the Mozilla root CA bundle. This bundle is intended be used together with the new "checkHost" option to validate server certs accepted by Mozilla. - New commandline options "-reload" to reload the configuration file and "-reopen" to reopen the log file of stunnel running as a Windows service (thx to Marc McLaughlin). - Added session persistence based on negotiated TLS sessions. https://en.wikipedia.org/wiki/Load_balancing_%28computing%29#Persistence The current implementation does not support external TLS session caching with sessiond. - MEDIUM ciphers (currently SEED and RC4) are removed from the default cipher list. - The "redirect" option was improved to not only redirect sessions established with an untrusted certificate, but also sessions established without a client certificate. - OpenSSL version checking modified to distinguish FIPS and non-FIPS builds. - Improved compatibility with the current OpenSSL 1.1.0-dev tree. - Removed support for OpenSSL versions older than 0.9.7. The final update for the OpenSSL 0.9.6 branch was 17 Mar 2004. - "sessiond" support improved to also work in OpenSSL 0.9.7. - Randomize the initial value of the round-robin counter. - New stunnel.conf templates are provided for Windows and Unix. * Bugfixes - Fixed compilation against old versions of OpenSSL. - Fixed memory leaks in certificate verification. ### Version 5.14, 2015.03.25, urgency: HIGH * Security bugfixes - The "redirect" option now also redirects clients on SSL session reuse. In stunnel versions 5.00 to 5.13 reused sessions were instead always connected hosts specified with the "connect" option regardless of their certificate verification result. This vulnerability was reported by Johan Olofsson. * New features - Windows service is automatically restarted after upgrade. * Bugfixes - Fixed a memory allocation error during Unix daemon shutdown. - Fixed handling multiple connect/redirect destinations. - OpenSSL FIPS builds are now correctly reported on startup. ### Version 5.13, 2015.03.20, urgency: MEDIUM * New features - The "service" option was modified to also control the syslog service name. * Bugfixes - Fixed Windows service crash. ### Version 5.12, 2015.03.19, urgency: HIGH * Security bugfixes - OpenSSL DLLs updated to version 1.0.2a. https://www.openssl.org/news/secadv_20150319.txt * New features - New service-level option "logId" to specify the connection identifier type. Currently supported types: "sequential" (default), "unique", and "thread". - New service-level option "debug" to individually control logging verbosity of defined services. * Bugfixes - OCSP fixed on Windows platform (thx to Alec Kosky). ### Version 5.11, 2015.03.11, urgency: LOW * New features - OpenSSL DLLs updated to version 1.0.2. - Removed dereferences of internal OpenSSL data structures. - PSK key lookup algorithm performance improved from O(N) (linear) to O(log N) (logarithmic). * Bugfixes - Fixed peer certificate list in the main window on Win32 (thx to @fyer for reporting it). - Fixed console logging in tstunnel.exe. - _tputenv_s() replaced with more portable _tputenv() on Win32. ### Version 5.10, 2015.01.22, urgency: LOW * New features - OCSP AIA (Authority Information Access) support. This feature can be enabled with the new service-level option "OCSPaia". - Additional security features of the linker are enabled: "-z relro", "-z now", "-z noexecstack". * Bugfixes - OpenSSL DLLs updated to version 1.0.1l. https://www.openssl.org/news/secadv_20150108.txt - FIPS canister updated to version 2.0.9 in the Win32 binary build. ### Version 5.09, 2015.01.02, urgency: LOW * New features - Added PSK authentication with two new service-level configuration file options "PSKsecrets" and "PSKidentity". - Added additional security checks to the OpenSSL memory management functions. - Added support for the OPENSSL_NO_OCSP and OPENSSL_NO_ENGINE OpenSSL configuration flags. - Added compatibility with the current OpenSSL 1.1.0-dev tree. * Bugfixes - Removed defective s_poll_error() code occasionally causing connections to be prematurely closed (truncated). This bug was introduced in stunnel 4.34. - Fixed ./configure systemd detection (thx to Kip Walraven). - Fixed ./configure sysroot detection (thx to Kip Walraven). - Fixed compilation against old versions of OpenSSL. - Removed outdated French manual page. ### Version 5.08, 2014.12.09, urgency: MEDIUM * New features - Added SOCKS4/SOCKS4a protocol support. - Added SOCKS5 protocol support. - Added SOCKS RESOLVE [F0] TOR extension support. - Updated automake to version 1.14.1. - OpenSSL directory searching is now relative to the sysroot. * Bugfixes - Fixed improper hangup condition handling. - Fixed missing -pic linker option. This is required for Android 5.0 and improves security. ### Version 5.07, 2014.11.01, urgency: MEDIUM * New features - Several SMTP server protocol negotiation improvements. - Added UTF-8 byte order marks to stunnel.conf templates. - DH parameters are no longer generated by "make cert". The hardcoded DH parameters are sufficiently secure, and modern TLS implementations will use ECDH anyway. - Updated manual for the "options" configuration file option. - Added support for systemd 209 or later. - New --disable-systemd ./configure option. - setuid/setgid commented out in stunnel.conf-sample. * Bugfixes - Added support for UTF-8 byte order mark in stunnel.conf. - Compilation fix for OpenSSL with disabled SSLv2 or SSLv3. - Non-blocking mode set on inetd and systemd descriptors. - shfolder.h replaced with shlobj.h for compatibility with modern Microsoft compilers. ### Version 5.06, 2014.10.15, urgency: HIGH * Security bugfixes - OpenSSL DLLs updated to version 1.0.1j. https://www.openssl.org/news/secadv_20141015.txt - The insecure SSLv2 protocol is now disabled by default. It can be enabled with "options = -NO_SSLv2". - The insecure SSLv3 protocol is now disabled by default. It can be enabled with "options = -NO_SSLv3". - Default sslVersion changed to "all" (also in FIPS mode) to autonegotiate the highest supported TLS version. * New features - Added missing SSL options to match OpenSSL 1.0.1j. - New "-options" commandline option to display the list of supported SSL options. * Bugfixes - Fixed FORK threading build regression bug. - Fixed missing periodic Win32 GUI log updates. ### Version 5.05, 2014.10.10, urgency: MEDIUM * New features - Asynchronous communication with the GUI thread for faster logging on Win32. - systemd socket activation (thx to Mark Theunissen). - The parameter of "options" can now be prefixed with "-" to clear an SSL option, for example: "options = -LEGACY_SERVER_CONNECT". - Improved "transparent = destination" manual page (thx to Vadim Penzin). * Bugfixes - Fixed POLLIN|POLLHUP condition handling error resulting in prematurely closed (truncated) connection. - Fixed a null pointer dereference regression bug in the "transparent = destination" functionality (thx to Vadim Penzin). This bug was introduced in stunnel 5.00. - Fixed startup thread synchronization with Win32 GUI. - Fixed erroneously closed stdin/stdout/stderr if specified as the -fd commandline option parameter. - A number of minor Win32 GUI bugfixes and improvements. - Merged most of the Windows CE patches (thx to Pierre Delaage). - Fixed incorrect CreateService() error message on Win32. - Implemented a workaround for defective Cygwin file descriptor passing breaking the libwrap support: http://wiki.osdev.org/Cygwin_Issues#Passing_file_descriptors ### Version 5.04, 2014.09.21, urgency: LOW * New features - Support for local mode ("exec" option) on Win32. - Support for UTF-8 config file and log file. - Win32 UTF-16 build (thx to Pierre Delaage for support). - Support for Unicode file names on Win32. - A more explicit service description provided for the Windows SCM (thx to Pierre Delaage). - TCP/IP dependency added for NT service in order to prevent initialization failure at boot time. - FIPS canister updated to version 2.0.8 in the Win32 binary build. * Bugfixes - load_icon_default() modified to return copies of default icons instead of the original resources to prevent the resources from being destroyed. - Partially merged Windows CE patches (thx to Pierre Delaage). - Fixed typos in stunnel.init.in and vc.mak. - Fixed incorrect memory allocation statistics update in str_realloc(). - Missing REMOTE_PORT environmental variable is provided to processes spawned with "exec" on Unix platforms. - Taskbar icon is no longer disabled for NT service. - Fixed taskbar icon initialization when commandline options are specified. - Reportedly more compatible values used for the dwDesiredAccess parameter of the CreateFile() function (thx to Pierre Delaage). - A number of minor Win32 GUI bugfixes and improvements. ### Version 5.03, 2014.08.07, urgency: HIGH * Security bugfixes - OpenSSL DLLs updated to version 1.0.1i. See https://www.openssl.org/news/secadv_20140806.txt * New features - FIPS autoconfiguration cleanup. - FIPS canister updated to version 2.0.6. - Improved SNI diagnostic logging. * Bugfixes - Compilation fixes for old versions of OpenSSL. - Fixed whitespace handling in the stunnel.init script. ### Version 5.02, 2014.06.09, urgency: HIGH * Security bugfixes - OpenSSL DLLs updated to version 1.0.1h. See https://www.openssl.org/news/secadv_20140605.txt * New features - Major rewrite of the protocol.c interface: it is now possible to add protocol negotiations at multiple connection phases, protocols can individually decide whether the remote connection will be established before or after SSL/TLS is negotiated. - Heap memory blocks are wiped before release. This only works for block allocated by stunnel, and not by OpenSSL or other libraries. - The safe_memcmp() function implemented with execution time not dependent on the compared data. - Updated the stunnel.conf and stunnel.init templates. - Added a client-mode example to the manual. * Bugfixes - Fixed "failover = rr" broken since version 5.00. - Fixed "taskbar = no" broken since version 5.00. - Compilation fix for missing SSL_OP_MSIE_SSLV2_RSA_PADDING option. ### Version 5.01, 2014.04.08, urgency: HIGH * Security bugfixes - OpenSSL DLLs updated to version 1.0.1g. This version mitigates TLS heartbeat read overrun (CVE-2014-0160). * New features - X.509 extensions added to the created self-signed stunnel.pem. - "FIPS = no" also allowed in non-FIPS builds of stunnel. - Search all certificates with the same subject name for a matching public key rather than only the first one (thx to Leon Winter). - Create logs in the local application data folder if stunnel folder is not writable on Win32. * Bugfixes - close_notify not sent when SSL still has some data buffered. - Protocol negotiation with server-side SNI fixed. - A Mac OS X missing symbols fixed. - Win32 configuration file reload crash fixed. - Added s_pool_free() on exec+connect service retires. - Line-buffering enforced on stderr output. ### stunnel 5.00 disables some features previously enabled by default. ### Users should review whether the new defaults are appropriate for their ### particular deployments. Packages maintainers may consider prepending ### the old defaults for "fips" (if supported by their OpenSSL library), ### "pid" and "libwrap" to stunnel.conf during automated updates. ### Version 5.00, 2014.03.06, urgency: HIGH * Security bugfixes - Added PRNG state update in fork threading (CVE-2014-0016). * New global configuration file defaults - Default "fips" option value is now "no", as FIPS mode is only helpful for compliance, and never for actual security. - Default "pid" is now "", i.e. not to create a pid file at startup. * New service-level configuration file defaults - Default "ciphers" updated to "HIGH:MEDIUM:+3DES:+DH:!aNULL:!SSLv2" due to AlFBPPS attack and bad performance of DH ciphersuites. - Default "libwrap" setting is now "no" to improve performance. * New features - OpenSSL DLLs updated to version 1.0.1f. - zlib DLL updated to version 1.2.8. - autoconf scripts upgraded to version 2.69. - TLS 1.1 and TLS 1.2 are now allowed in the FIPS mode. - New service-level option "redirect" to redirect SSL client connections on authentication failures instead of rejecting them. - New global "engineDefault" configuration file option to control which OpenSSL tasks are delegated to the current engine. Available tasks: ALL, RSA, DSA, ECDH, ECDSA, DH, RAND, CIPHERS, DIGESTS, PKEY, PKEY_CRYPTO, PKEY_ASN1. - New service-level configuration file option "engineId" to select the engine by identifier, e.g. "engineId = capi". - New global configuration file option "log" to control whether to append (the default), or to overwrite log file while (re)opening. - Different taskbar icon colors to indicate the service state. - New global configuration file options "iconIdle", "iconActive", and "iconError" to select status icon on GUI taskbar. - Removed the limit of 63 stunnel.conf sections on Win32 platform. - Installation of a sample certificate was moved to a separate "cert" target in order to allow unattended (e.g. scripted) installations. - Reduced length of the logged thread identifier. It is still based on the OS thread ID, and thus not unique over long periods of time. - Improved readability of error messages printed when stunnel refuses to start due to a critical error. * Bugfixes - LD_PRELOAD Solaris compatibility bug fixed (thx to Norm Jacobs). - CRYPTO_NUM_LOCKS replaced with CRYPTO_num_locks() to improve binary compatibility with diverse builds of OpenSSL (thx to Norm Jacobs). - Corrected round-robin failover behavior under heavy load. - Numerous fixes in the engine support code. - On Win32 platform .rnd file moved from c:\ to the stunnel folder. ### Version 4.57, 2015.04.01, urgency: HIGH * Security bugfixes - Added PRNG state update in fork threading (CVE-2014-0016). ### Version 4.56, 2013.03.22, urgency: HIGH * New features - Win32 installer automatically configures firewall exceptions. - Win32 installer configures administrative shortcuts to invoke UAC. - Improved Win32 GUI shutdown time. * Bugfixes - Fixed a regression bug introduced in version 4.55 causing random crashes on several platforms, including Windows 7. - Fixed startup crashes on some Win32 systems. - Fixed incorrect "stunnel -exit" process synchronisation. - Fixed FIPS detection with new versions of the OpenSSL library. - Failure to open the log file at startup is no longer ignored. ### Version 4.55, 2013.03.03, urgency: HIGH * Security bugfixes - Buffer overflow vulnerability fixed in the NTLM authentication of the CONNECT protocol negotiation. See https://www.stunnel.org/CVE-2013-1762.html for details. - OpenSSL updated to version 1.0.1e in Win32/Android builds. * New features - SNI wildcard matching in server mode. - Terminal version of stunnel (tstunnel.exe) build for Win32. * Bugfixes - Fixed write half-close handling in the transfer() function (thx to Dustin Lundquist). - Fixed EAGAIN error handling in the transfer() function (thx to Jan Bee). - Restored default signal handlers before execvp() (thx to Michael Weiser). - Fixed memory leaks in protocol negotiation (thx to Arthur Mesh). - Fixed a file descriptor leak during configuration file reload (thx to Arthur Mesh). - Closed SSL sockets were removed from the transfer() c->fds poll. - Minor fix in handling exotic inetd-mode configurations. - WCE compilation fixes. - IPv6 compilation fix in protocol.c. - Windows installer fixes. ### Version 4.54, 2012.10.09, urgency: MEDIUM * New Win32 features - FIPS module updated to version 2.0. - OpenSSL DLLs updated to version 1.0.1c. - zlib DLL updated to version 1.2.7. - Engine DLLs added: 4758cca, aep, atalla, capi, chil, cswift, gmp, gost, nuron, padlock, sureware, ubsec. * Other new features - "session" option renamed to more readable "sessionCacheTimeout". The old name remains accepted for backward compatibility. - New service-level "sessionCacheSize" option to control session cache size. - New service-level option "reset" to control whether TCP RST flag is used to indicate errors. The default value is "reset = yes". - New service-level option "renegotiation" to disable SSL renegotiation. This feature is based on a public-domain patch by Janusz Dziemidowicz. - New FreeBSD socket options: IP_FREEBIND, IP_BINDANY, IPV6_BINDANY (thx to Janusz Dziemidowicz). - New parameters to configure TLS v1.1/v1.2 with OpenSSL version 1.0.1 or higher (thx to Henrik Riomar). * Bugfixes - Fixed "Application Failed to Initialize Properly (0xc0150002)" error. - Fixed missing SSL state debug log entries. - Fixed a race condition in libwrap code resulting in random stalls (thx to Andrew Skalski). - Session cache purged at configuration file reload to reduce memory leak. Remaining leak of a few kilobytes per section is yet to be fixed. - Fixed a regression bug in "transparent = destination" functionality (thx to Stefan Lauterbach). This bug was introduced in stunnel 4.51. - "transparent = destination" is now a valid endpoint in inetd mode. - "delay = yes" fixed to work even if specified *after* "connect" option. - Multiple "connect" targets fixed to also work with delayed resolver. - The number of resolver retries of EAI_AGAIN error has been limited to 3 in order to prevent infinite loops. ### Version 4.53, 2012.03.19, urgency: MEDIUM * New features - Added client-mode "sni" option to directly control the value of TLS Server Name Indication (RFC 3546) extension. - Added support for IP_FREEBIND socket option with a pached Linux kernel. - Glibc-specific dynamic allocation tuning was applied to help unused memory deallocation. - Non-blocking OCSP implementation. * Bugfixes - Compilation fixes for old versions of OpenSSL (tested against 0.9.6). - Usage of uninitialized variables fixed in exec+connect services. - Occasional logging subsystem crash with exec+connect services. - OpenBSD compilation fix (thx to Michele Orru'). - Session id context initialized with session name rather than a constant. - Fixed handling of a rare inetd mode use case, where either stdin or stdout is a socket, but not both of them at the same time. - Fixed missing OPENSSL_Applink http://www.openssl.org/support/faq.html#PROG2 - Fixed crash on termination with FORK threading model. - Fixed dead canary after configuration reload with open connections. - Fixed missing file descriptors passed to local mode processes. - Fixed required jmp_buf alignment on Itanium platform. - Removed creating /dev/zero in the chroot jail on Solaris platform. - Fixed detection of WSAECONNREFUSED Winsock error. - Missing Microsoft.VC90.CRT.manifest added to Windows installer. ### Version 4.52, 2012.01.12, urgency: MEDIUM * Bugfixes - Fixed write closure notification for non-socket file descriptors. - Removed a line logged to stderr in inetd mode. - Fixed "Socket operation on non-socket" error in inetd mode on Mac OS X platform. - Removed direct access to the fields of the X509_STORE_CTX data structure. ### Version 4.51, 2012.01.09, urgency: MEDIUM * New features - Updated Win32 binary distribution OpenSSL DLLs to version 0.9.8s-fips. - Updated Android binary OpenSSL to version 1.0.0f. - Zlib support added to Win32 and Android binary builds. - New "compression = deflate" global option to enable RFC 2246 compresion. For compatibility with previous versions "compression = zlib" and "compression = rle" also enable the deflate (RFC 2246) compression. - Compression is disabled by default. - Separate default ciphers and sslVersion for "fips = yes" and "fips = no". - UAC support for editing configuration file with Windows GUI. * Bugfixes - Fixed exec+connect sections. - Added a workaround for broken Android getaddrinfo(): http://stackoverflow.com/questions/7818246/segmentation-fault-in-getaddrinfo ### Version 4.50, 2011.12.03, urgency: MEDIUM * New features - Added Android port. - Updated INSTALL.FIPS. * Bugfixes - Fixed internal memory allocation problem in inetd mode. - Fixed FIPS mode on Microsoft Vista, Server 2008, and Windows 7. This fix required to compile OpenSSL FIPS-compliant DLLs with MSVC 9.0, instead of MSVC 10.0. msvcr100.dll was replaced with msvcr90.dll. GPL compatibility issues are explained in the GPL FAQ: http://www.gnu.org/licenses/gpl-faq.html#WindowsRuntimeAndGPL - POP3 server-side protocol negotiation updated to report STLS capability (thx to Anthony Morgan). ### Version 4.49, 2011.11.28, urgency: MEDIUM * Bugfixes - Missing Microsoft Visual C++ Redistributable (msvcr100.dll) required by FIPS-compliant OpenSSL library was added to the Windows installer. - A bug was fixed causing crashes on MacOS X and some other platforms. ### Version 4.48, 2011.11.26, urgency: MEDIUM * New features - FIPS support on Win32 platform added. OpenSSL 0.9.8r DLLs based on FIPS 1.2.3 canister are included with this version of stunnel. FIPS mode can be disabled with "fips = no" configuration file option. * Bugfixes - Fixed canary initialization problem on Win32 platform. ### Version 4.47, 2011.11.21, urgency: MEDIUM * Internal improvements - CVE-2010-3864 workaround improved to check runtime version of OpenSSL rather than compiled version, and to allow OpenSSL 0.x.x >= 0.9.8p. - Encoding of man page sources changed to UTF-8. * Bugfixes - Handling of socket/SSL close in transfer() function was fixed. - Logging was modified to save and restore system error codes. - Option "service" was restricted to Unix, as since stunnel 4.42 it wasn't doing anything useful on Windows platform. ### Version 4.46, 2011.11.04, urgency: LOW * New features - Added Unix socket support (e.g. "connect = /var/run/stunnel/socket"). - Added "verify = 4" mode to ignore CA chain and only verify peer certificate. - Removed the limit of 16 IP addresses for a single 'connect' option. - Removed the limit of 256 stunnel.conf sections in PTHREAD threading model. It is still not possible have more than 63 sections on Win32 platform. http://msdn.microsoft.com/en-us/library/windows/desktop/ms740141(v=vs.85).aspx * Optimizations - Reduced per-connection memory usage. - Performed a major refactoring of internal data structures. Extensive internal testing was performed, but some regression bugs are expected. * Bugfixes - Fixed Win32 compilation with Mingw32. - Fixed non-blocking API emulation layer in UCONTEXT threading model. - Fixed signal handling in UCONTEXT threading model. ### Version 4.45, 2011.10.24, urgency: LOW * New features - "protocol = proxy" support to send original client IP address to haproxy: http://haproxy.1wt.eu/download/1.5/doc/proxy-protocol.txt This requires accept-proxy bind option of haproxy 1.5-dev3 or later. - Added Win32 configuration reload without a valid configuration loaded. - Added compatibility with LTS OpenSSL versions 0.9.6 and 0.9.7. Some features are only available in OpenSSL 1.0.0 and later. * Performance optimizations - Use SSL_MODE_RELEASE_BUFFERS if supported by the OpenSSL library. - Libwrap helper processes are no longer started if libwrap is disabled in all sections of the configuration file. * Internal improvements - Protocol negotiation framework was rewritten to support additional code to be executed after SSL_accept()/SSL_connect(). - Handling of memory allocation errors was rewritten to gracefully terminate the process (thx to regenrecht for the idea). * Bugfixes - Fixed -l option handling in stunnel3 script (thx to Kai Gülzau). - Script to build default stunnel.pem was fixed (thx to Sebastian Kayser). - MinGW compilation script (mingw.mak) was fixed (thx to Jose Alf). - MSVC compilation script (vc.mak) was fixed. - A number of problems in WINSOCK error handling were fixed. ### Version 4.44, 2011.09.17, urgency: MEDIUM * New features - Major automake/autoconf cleanup. - Heap buffer overflow protection with canaries. - Stack buffer overflow protection with -fstack-protector. * Bugfixes - Fixed garbled error messages on errors with setuid/setgid options. - SNI fixes (thx to Alexey Drozdov). - Use after free in fdprintf() (thx to Alexey Drozdov). This issue might cause GPF with "protocol" or "ident" options. ### Version 4.43, 2011.09.07, urgency: MEDIUM * New features - Updated Win32 DLLs for OpenSSL 1.0.0e. - Major optimization of the logging subsystem. Benchmarks indicate up to 15% stunnel performance improvement. * Bugfixes - Fixed Win32 configuration file reload. - Fixed FORK and UCONTEXT threading models. - Corrected INSTALL.W32 file. ### Version 4.42, 2011.08.18, urgency: HIGH * New features - New verify level 0 to request and ignore peer certificate. This feature is useful with the new Windows GUI menu to save cached peer certificate chains, as SSL client certificates are not sent by default. - Manual page has been updated. - Removed support for changing Windows Service name with "service" option. * Bugfixes - Fixed a heap corruption vulnerability in versions 4.40 and 4.41. It may possibly be leveraged to perform DoS or remote code execution attacks. - The -quiet commandline option was applied to *all* message boxes. - Silent install (/S option) no longer attempts to create stunnel.pem. ### Version 4.41, 2011.07.25, urgency: MEDIUM * Bugfixes - Fixed Windows service crash of stunnel 4.40. ### Version 4.40, 2011.07.23, urgency: LOW * New Win32 features - Added a GUI menu to save cached peer certificate chains. - Added comandline "-exit" option to stop stunnel *not* running as a service. This option may be useful for scripts. - Added file version information to stunnel.exe. - A number of other GUI improvements. * Other new features - Hardcoded 2048-bit DH parameters are used as a fallback if DH parameters are not provided in stunnel.pem. - Default "ciphers" value updated to prefer ECDH: "ALL:!SSLv2:!aNULL:!EXP:!LOW:-MEDIUM:RC4:+HIGH". - Default ECDH curve updated to "prime256v1". - Removed support for temporary RSA keys (used in obsolete export ciphers). ### Version 4.39, 2011.07.06, urgency: LOW * New features - New Win32 installer module to build self-signed stunnel.pem. - Added configuration file editing with Windows GUI. - Added log file reopening file editing with Windows GUI. It might be useful to also implement log file rotation. - Improved configuration file reload with Windows GUI. ### Version 4.38, 2011.06.28, urgency: MEDIUM * New features - Server-side SNI implemented (RFC 3546 section 3.1) with a new service-level option "nsi". - "socket" option also accepts "yes" and "no" for flags. - Nagle's algorithm is now disabled by default for improved interactivity. * Bugfixes - A compilation fix was added for OpenSSL version < 1.0.0. - Signal pipe set to non-blocking mode. This bug caused hangs of stunnel features based on signals, e.g. local mode, FORK threading, or configuration file reload on Unix. Win32 platform was not affected. ### Version 4.37, 2011.06.17, urgency: MEDIUM * New features - Client-side SNI implemented (RFC 3546 section 3.1). - Default "ciphers" changed from the OpenSSL default to a more secure and faster "RC4-MD5:HIGH:!aNULL:!SSLv2". A paranoid (and usually slower) setting would be "HIGH:!aNULL:!SSLv2". - Recommended "options = NO_SSLv2" added to the sample stunnel.conf file. - Default client method upgraded from SSLv3 to TLSv1. To connect servers without TLS support use "sslVersion = SSLv3" option. - Improved --enable-fips and --disable-fips ./configure option handling. - On startup stunnel now compares the compiled version of OpenSSL against the running version of OpenSSL. A warning is logged on mismatch. * Bugfixes - Non-blocking socket handling in local mode fixed (Debian bug #626856). - UCONTEXT threading mode fixed. - Removed the use of gcc Thread-Local Storage for improved portability. - va_copy macro defined for platforms that do not have it. - Fixed "local" option parsing on IPv4 systems. - Solaris compilation fix (redefinition of "STR"). ### Version 4.36, 2011.05.03, urgency: LOW * New features - Updated Win32 DLLs for OpenSSL 1.0.0d. - Dynamic memory management for strings manipulation: no more static STRLEN limit, lower stack footprint. - Strict public key comparison added for "verify = 3" certificate checking mode (thx to Philipp Hartwig). - Backlog parameter of listen(2) changed from 5 to SOMAXCONN: improved behavior on heavy load. - Example tools/stunnel.service file added for systemd service manager. * Bugfixes - Missing pthread_attr_destroy() added to fix memory leak (thx to Paul Allex and Peter Pentchev). - Fixed the incorrect way of setting FD_CLOEXEC flag. - Fixed --enable-libwrap option of ./configure script. - /opt/local added to OpenSSL search path for MacPorts compatibility. - Workaround implemented for signal handling on MacOS X. - A trivial bug fixed in the stunnel.init script. - Retry implemented on EAI_AGAIN error returned by resolver calls. ### Version 4.35, 2011.02.05, urgency: LOW * New features - Updated Win32 DLLs for OpenSSL 1.0.0c. - Transparent source (non-local bind) added for FreeBSD 8.x. - Transparent destination ("transparent = destination") added for Linux. * Bugfixes - Fixed reload of FIPS-enabled stunnel. - Compiler options are now auto-detected by ./configure script in order to support obsolete versions of gcc. - Async-signal-unsafe s_log() removed from SIGTERM/SIGQUIT/SIGINT handler. - CLOEXEC file descriptor leaks fixed on Linux >= 2.6.28 with glibc >= 2.10. Irreparable race condition leaks remain on other Unix platforms. This issue may have security implications on some deployments: http://udrepper.livejournal.com/20407.html - Directory lib64 included in the OpenSSL library search path. - Windows CE compilation fixes (thx to Pierre Delaage). - Deprecated RSA_generate_key() replaced with RSA_generate_key_ex(). * Domain name changes (courtesy of Bri Hatch) - http://stunnel.mirt.net/ --> http://www.stunnel.org/ - ftp://stunnel.mirt.net/ --> http://ftp.stunnel.org/ - stunnel.mirt.net::stunnel --> rsync.stunnel.org::stunnel - stunnel-users@mirt.net --> stunnel-users@stunnel.org - stunnel-announce@mirt.net --> stunnel-announce@stunnel.org ### Version 4.34, 2010.09.19, urgency: LOW * New features - Updated Win32 DLLs for OpenSSL 1.0.0a. - Updated Win32 DLLs for zlib 1.2.5. - Updated automake to version 1.11.1 - Updated libtool to version 2.2.6b - Added ECC support with a new service-level "curve" option. - DH support is now enabled by default. - Added support for OpenSSL builds with some algorithms disabled. - ./configure modified to support cross-compilation. - Sample stunnel.init updated based on Debian init script. * Bugfixes - Implemented fixes in user interface to enter engine PIN. - Fixed a transfer() loop issue on socket errors. - Fixed missing Win32 taskbar icon while displaying a global option error. ### Version 4.33, 2010.04.05, urgency: MEDIUM * New features - Win32 DLLs for OpenSSL 1.0.0. This library requires to c_rehash CApath/CRLpath directories on upgrade. - Win32 DLLs for zlib 1.2.4. - Experimental support for local mode on Win32 platform. Try "exec = c:\windows\system32\cmd.exe". * Bugfixes - Inetd mode fixed. ### Version 4.32, 2010.03.24, urgency: MEDIUM * New features - New service-level "libwrap" option for run-time control whether /etc/hosts.allow and /etc/hosts.deny are used for access control. Disabling libwrap significantly increases performance of stunnel. - Win32 DLLs for OpenSSL 0.9.8m. * Bugfixes - Fixed a transfer() loop issue with SSLv2 connections. - Fixed a "setsockopt IP_TRANSPARENT" warning with "local" option. - Logging subsystem bugfixes and cleanup. - Installer bugfixes for Vista and later versions of Windows. - FIPS mode can be enabled/disabled at runtime. ### Version 4.31, 2010.02.03, urgency: MEDIUM * New features - Log file reopen on USR1 signal was added. * Bugfixes - Some regression issues introduced in 4.30 were fixed. ### Version 4.30, 2010.01.21, urgency: LOW/EXPERIMENTAL * New features - Graceful configuration reload with HUP signal on Unix and with GUI on Windows. ### Version 4.29, 2009.12.02, urgency: MEDIUM * New feature sponsored by Searchtech Limited http://www.astraweb.com/ - sessiond, a high performance SSL session cache was built for stunnel. A new service-level "sessiond" option was added. sessiond is available for download on ftp://ftp.stunnel.org/stunnel/sessiond/ . stunnel clusters will be a lot faster, now! * Bugfixes - "execargs" defaults to the "exec" parameter (thx to Peter Pentchev). - Compilation fixes added for AIX and old versions of OpenSSL. - Missing "fips" option was added to the manual. ### Version 4.28, 2009.11.08, urgency: MEDIUM * New features - Win32 DLLs for OpenSSL 0.9.8l. - Transparent proxy support on Linux kernels >=2.6.28. See the manual for details. - New socket options to control TCP keepalive on Linux: TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL. - SSL options updated for the recent version of OpenSSL library. * Bugfixes - A serious bug in asynchronous shutdown code fixed. - Data alignment updated in libwrap.c. - Polish manual encoding fixed. - Notes on compression implementation in OpenSSL added to the manual. ### Version 4.27, 2009.04.16, urgency: MEDIUM * New features - Win32 DLLs for OpenSSL 0.9.8k. - FIPS support was updated for openssl-fips 1.2. - New priority failover strategy for multiple "connect" targets, controlled with "failover=rr" (default) or "failover=prio". - pgsql protocol negotiation by Marko Kreen . - Building instructions were updated in INSTALL.W32 file. * Bugfixes - Libwrap helper processes fixed to close standard input/output/error file descriptors. - OS2 compilation fixes. - WCE fixes by Pierre Delaage . ### Version 4.26, 2008.09.20, urgency: MEDIUM * New features - Win32 DLLs for OpenSSL 0.9.8i. - /etc/hosts.allow and /etc/hosts.deny no longer need to be copied to the chrooted directory, as the libwrap processes are no longer chrooted. - A more informative error messages for invalid port number specified in stunnel.conf file. - Support for Microsoft Visual C++ 9.0 Express Edition. * Bugfixes - Killing all libwrap processes at stunnel shutdown fixed. - A minor bug in stunnel.init sample SysV startup file fixed. ### Version 4.25, 2008.06.01, urgency: MEDIUM * New features - Win32 DLLs for OpenSSL 0.9.8h. * Bugfixes - Spawning libwrap processes delayed until privileges are dropped. - Compilation fix for systems without struct msghdr.msg_control. ### Version 4.24, 2008.05.19, urgency: HIGH * Bugfixes - OCSP code was fixed to properly reject revoked certificates. ### Version 4.23, 2008.05.03, urgency: HIGH * Bugfixes - Local privilege escalation bug on Windows NT based systems fixed. A local user could exploit stunnel running as a service to gain localsystem privileges. ### Version 4.22, 2008.03.28, urgency: MEDIUM * New features - Makefile was updated to use standard autoconf variables: sysconfdir, localstatedir and pkglibdir. - A new global option to control logging to syslog: syslog = yes|no Simultaneous logging to a file and the syslog is now possible. - A new service-level option to control stack size: stack = * Bugfixes - Restored chroot() to be executed after decoding numerical userid and groupid values in drop_privileges(). - A few bugs fixed the in the new libwrap support code. - TLSv1 method used by default in FIPS mode instead of SSLv3 client and SSLv23 server methods. - OpenSSL GPL license exception update based on http://www.gnu.org/licenses/gpl-faq.html#GPLIncompatibleLibs ### Version 4.21, 2007.10.27, urgency: LOW/EXPERIMENTAL * New features sponsored by Open-Source Software Institute - Initial FIPS 140-2 support (see INSTALL.FIPS for details). Win32 platform is not currently supported. * New features - Experimental fast support for non-MT-safe libwrap is provided with pre-spawned processes. - Stunnel binary moved from /usr/local/sbin to /usr/local/bin in order to meet FHS and LSB requirements. Please delete the /usr/local/sbin/stunnel when upgrading. - Added code to disallow compiling stunnel with pthreads when OpenSSL is compiled without threads support. - Win32 DLLs for OpenSSL 0.9.8g. - Minor manual update. - TODO file updated. * Bugfixes - Dynamic locking callbacks added (needed by some engines to work). - AC_ARG_ENABLE fixed in configure.am to accept yes/no arguments. - On some systems libwrap requires yp_get_default_domain from libnsl, additional checking for libnsl was added to the ./configure script. - Sending a list of trusted CAs for the client to choose the right certificate restored. - Some compatibility issues with NTLM authentication fixed. - Taskbar icon (unless there is a config file parsing error) and "Save As" disabled in the service mode for local Win32 security (it's much like Yeti -- some people claim they have seen it). ### Version 4.20, 2006.11.30, urgency: MEDIUM * Release notes - The new transfer() function has been well tested. I recommend upgrading any previous version with this one. * Bugfixes - Fixed support for encrypted passphrases on Unix (broken in 4.19). - Reduced amount of debug logs. - A minor man page update. ### Version 4.19, 2006.11.11, urgency: LOW/EXPERIMENTAL * Release notes - There are a lot of new features in this version. I recommend to test it well before upgrading your mission-critical systems. * New features - New service-level option to specify an OCSP responder flag: OCSPflag = - "protocolCredentials" option changed to "protocolUsername" and "protocolPassword" - NTLM support to be enabled with the new service-level option: protocolAuthentication = NTLM - imap protocol negotiation support added. - Passphrase cache was added so the user does not need to reenter the same passphrase for each defined service any more. - New service-level option to retry exec+connect section: retry = yes|no - Local IP and port is logged for each established connection. - Win32 DLLs for OpenSSL 0.9.8d. * Bugfixes - Serious problem with SSL_WANT_* retries fixed. The new code requires extensive testing! ### Version 4.18, 2006.09.26, urgency: MEDIUM * Bugfixes - GPF on entering private key pass phrase on Win32 fixed. - Updated OpenSSL Win32 DLLs. - Minor configure script update. ### Version 4.17, 2006.09.10, urgency: MEDIUM * New features - Win32 DLLs for OpenSSL 0.9.8c. * Bugfixes - Problem with detecting getaddrinfo() in ./configure fixed. - Compilation problem due to misplaced #endif in ssl.c fixed. - Duplicate 220 in smtp_server() function in protocol.c fixed. - Minor os2.mak update. - Minor update of safestring()/safename() macros. ### Version 4.16, 2006.08.31, urgency: MEDIUM * New features sponsored by Hewlett-Packard - A new global option to control engine: engineCtrl = [:] - A new service-level option to select engine to read private key: engineNum = - OCSP support: ocsp = * New features - A new option to select version of SSL protocol: sslVersion = all|SSLv2|SSLv3|TLSv1 - Visual Studio vc.mak by David Gillingham . - OS2 support by Paul Smedley (http://smedley.info) * Bugfixes - An ordinary user can install stunnel again. - Compilation problem with --enable-dh fixed. - Some minor compilation warnings fixed. - Service-level CRL cert store implemented. - GPF on protocol negotiations fixed. - Problem detecting addrinfo() on Tru64 fixed. - Default group is now detected by configure script. - Check for maximum number of defined services added. - OpenSSL_add_all_algorithms() added to SSL initialization. - configure script sections reordered to detect pthread library functions. - RFC 2487 autodetection improved. High resolution s_poll_wait() not currently supported by UCONTEXT threading. - More precise description of cert directory file names (thx to Muhammad Muquit). * Other changes - Maximum number of services increased from 64 to 256 when poll() is used. ### Version 4.15, 2006.03.11, urgency: LOW * Release notes - There are a lot of new features in this version. I recommend to test it well before upgrading your mission-critical systems. * Bugfixes - Fix for pthreads on Solaris 10. - Attempt to autodetect socklen_t type in configure script. - Default threading model changed to pthread for better portability. - DH parameters are not included in the certificate by default. * New features sponsored by Software House http://www.swhouse.com/ - Most SSL-related options (including client, cert, key) are now available on service-level, so it is possible to have an SSL client and an SSL server in a single stunnel process. - Windows CE (version 3.0 and higher) support. * New features - Client mode CONNECT protocol support (RFC 2817 section 5.2). http://www.ietf.org/rfc/rfc2817.txt - Retrying exec+connect services added. * File locations are more compliant to Filesystem Hierarchy Standard 2.3 - configuration and certificates are in $prefix/etc/stunnel/ - binaries are in $prefix/sbin/ - default pid file is $prefix/var/run/stunnel.pid - manual is $prefix/man/man8/stunnel.8 - other docs are in $prefix/share/doc/stunnel/ - libstunnel is in $prefix/lib - chroot directory is setup in $prefix/var/lib/stunnel/ this directory is chmoded 1770 and group nogroup ### Version 4.14, 2005.11.02, urgency: HIGH * Bugfixes - transfer() fixed to avoid random stalls introduced in version 4.12. - poll() error handing bug fixed. - Checking for dynamic loader libraries added again. - Default pidfile changed from $localstatedir/run/stunnel.pid to $localstatedir/stunnel/stunnel.pid. - Basic SSL library initialization moved to the beginning of execution. * Release notes - This is an important bugfix release. Upgrade is recommended. ### Version 4.13, 2005.10.21, urgency: MEDIUM * DLLs for OpenSSL 0.9.7i included because protection faults were reported in 0.9.8 and 0.9.8a. * New features - Libwrap code is executed as a separate process (no more delays due to a global and potentially long critical section). * Bugfixes - Problem with zombies in UCONTEXT threading fixed. - Workaround for non-standard makecontext() uc_stack.ss_sp parameter semantics on SGI IRIX. - Protection fault in signals handling on IRIX fixed. - Problem finding pthread library on AIX fixed. - size_t printf() fixed in stack_info() (the previous fix didn't work). - socklen_t is used instead of int where required. ### Version 4.12, 2005.09.29, urgency: MEDIUM * New features - Win32 installer added. - New Win32 commandline options: -start and -stop. - Log level and thread number are reported to syslog. - DLLs for OpenSSL 0.9.8. - stunnel.spec updated by neeo . * Bugfixes - Use of broken poll() is disabled on Mac OS X. - Yet another transfer() infinite loop condition fixed. - Workaround for a serious M$ bug (KB177346). - IPv6 DLLs allocation problem resulting in GPF on W2K fixed. - zlib added to shared libraries (OpenSSL may need it). - size_t printf() fixed in stack_info(). * Release notes - This is a bugfix release. Upgrade is recommended. ### Version 4.11, 2005.07.09, urgency: MEDIUM * New features - New ./configure option --with-threads to select thread model. - ./configure option --with-tcp-wrappers renamed to --disable-libwrap. I hope the meaning of the option is much more clear, now. * Bugfixes - Workaround for non-standard makecontext() uc_stack.ss_sp parameter semantics on Sparc/Solaris 9 and earlier. - scan_waiting_queue() no longer drops contexts. - Inetd mode GPFs with UCONTEXT fixed. - Cleanup context is no longer used. - Releasing memory of the current context is delayed. - Win32 headers reordered for Visual Studio 7. - Some Solaris compilation warnings fixed. - Rejected inetd mode without 'connect' or 'exec'. * Release notes - UCONTEXT threading seems stable, now. Upgrade is recommended. ### Version 4.10, 2005.04.23, urgency: LOW/EXPERIMENTAL * DLLs for OpenSSL 0.9.7g. * Bugfixes - Missing locking on Win32 platform was added (thx to Yi Lin ) - Some problems with closing SSL fixed. * New features - New UCONTEXT user-level non-preemptive threads model is used on systems that support SYSV-compatible ucontext.h. - Improved stunnel3 script with getopt-compatible syntax. * Release notes - This version should be thoroughly tested before using it in the mission-critical environment. ### Version 4.09, 2005.03.26, urgency: MEDIUM * DLLs for OpenSSL 0.9.7f. * Bugfixes - Compilation problem with undeclared socklen_t fixed. - TIMEOUTclose is not used when there is any data in the buffers. - Stunnel no longer relies on close_notify with SSL 2.0 connections, since SSL 2.0 protocol does not have any alerts defined. - Closing SSL socket when there is some data in SSL output buffer is detected and reported as an error. - Install/chmod race condition when installing default certificate fixed. - Stunnel no longer installs signal_handler on ignored signals. ### Version 4.08, 2005.02.27, urgency: LOW * New features - New -quiet option was added to install NT service without a message box. * Bugfixes - Using $(DESTDIR) in tools/Makefile.am. - Define NI_NUMERICHOST and NI_NUMERICSERV when needed. - Length of configuration file line increased from 256B to 16KB. - Stunnel sends close_notify when a close_notify is received from SSL peer and all remaining data is sent to SSL peer. - Some fixes for bugs detected by the watchdog. * Release notes - There were many changes in the transfer() function (the main loop). - This version should be thoroughly tested before using it in the mission-critical environment. ### Version 4.07, 2005.01.03, urgency: MEDIUM * Bugfixes - Problem with infinite poll() timeout negative, but not equal to -1 fixed. - Problem with a file descriptor ready to be read just after a non-blocking connect call fixed. - Compile error with EAI_NODATA not defined or equal to EAI_NONAME fixed. - IP address and TCP port textual representation length (IPLEN) increased to 128 bytes. - OpenSSL engine support is only used if engine.h header file exists. - Broken NT Service mode on Win32 platform fixed. - Support for IPv4-only Win32 machines restored. ### Version 4.06, 2004.12.26, urgency: LOW * New feature sponsored by SURFnet http://www.surfnet.nl/ - IPv6 support (to be enabled with ./configure --enable-ipv6). * New features - poll() support - no more FD_SETSIZE limit! - Multiple connect=host:port options are allowed in a single service section. Remote hosts are connected using round-robin algorithm. This feature is not compatible with delayed resolver. - New 'compression' option to enable compression. To use zlib algorithm you have to enable it when building OpenSSL library. - New 'engine' option to select a hardware engine. - New 'TIMEOUTconnect' option with 10 seconds default added. - stunnel3 perl script to emulate version 3.x command line options. - French manual updated by Bernard Choppy . - A watchdog to detect transfer() infinite loops added. - Configuration file comment character changed from '#' to ';'. '#' will still be recognized to keep compatibility. - MT-safe getaddrinfo() and getnameinfo() are used where available to get better performance on resolver calls. - Automake upgraded from 1.4-p4 to 1.7.9. * Bugfixes - log() changed to s_log() to avoid conflicts on some systems. - Common CRIT_INET critical section introduced instead of separate CRIT_NTOA and CRIT_RESOLVER to avoid potential problems with libwrap (TCP Wrappers) library. - CreateThread() finally replaced with _beginthread() on Win32. - make install creates $(localstatedir)/stunnel. $(localstatedir)/stunnel/dev/zero is also created on Solaris. - Race condition with client session cache fixed. - Other minor bugfixes. * Release notes - Win32 port requires Winsock2 to work. Some Win95 systems may need a free update from Microsoft. http://www.microsoft.com/windows95/downloads/ - Default is *not* to use IPv6 '::' for accept and '::1' for connect. For example to accept pop3s on IPv6 you could use: 'accept = :::995'. I hope the new syntax is clear enough. ### Version 4.05, 2004.02.14, urgency: MEDIUM * New feature sponsored by SURFnet http://www.surfnet.nl/ - Support for CIFS aka SMB protocol SSL negotiation. * New features - CRL support with new CRLpath and CRLfile global options. - New 'taskbar' option on Win32 (thx to Ken Mattsen ). - New -fd command line parameter to read configuration from a specified file descriptor instead of a file. - accept is reported as error when no '[section]' is defined (in stunnel 4.04 it was silently ignored causing problems for lusers who did not read the fine manual). - Use fcntl() instead of ioctlsocket() to set socket nonblocking where it is supported. - Basic support for hardware engines with OpenSSL >= 0.9.7. - French manual by Bernard Choppy . - Thread stack size reduced to 64KB for maximum scalability. - Added optional code to debug thread stack usage. - Support for nsr-tandem-nsk (thx to Tom Bates ). * Bugfixes - TCP wrappers code moved to CRIT_NTOA critical section since it uses static inet_ntoa() result buffer. - SSL_ERROR_SYSCALL handling problems fixed. - added code to retry nonblocking SSL_shutdown() calls. - Use FD_SETSIZE instead of 16 file descriptors in inetd mode. - fdscanf groks lowercase protocol negotiation commands. - Win32 taskbar GDI objects leak fixed. - Libwrap detection bug in ./configure script fixed. - grp.h header detection fixed for NetBSD and possibly other systems. - Some other minor updates. ### Version 4.04, 2003.01.12, urgency: MEDIUM * New feature sponsored by SURFnet http://www.surfnet.nl/ - Encrypted private key can be used with Win32 GUI. * New features - New 'options' configuration option to setup OpenSSL library hacks with SSL_CTX_set_options(). - 'service' option also changes the name for TCP Wrappers access control in inetd mode. - Support for BeOS (thx to Mike I. Kozin ) - SSL is negotiated before connecting remote host or spawning local process whenever possible. - REMOTE_HOST variable is always placed in the enrivonment of a process spawned with 'exec'. - Whole SSL error stack is dumped on errors. - 'make cert' rule is back (was missing since 4.00). - Manual page updated (special thanks to Brian Hatch). - TODO updated. * Bugfixes - Major code cleanup (thx to Steve Grubb ). - Unsafe functions are removed from SIGCHLD handler. - Several bugs in auth_user() fixed. - Incorrect port when using 'local' option fixed. - OpenSSL tools '-rand' option is no longer directly used with a device (like '/dev/urandom'). Temporary random file is created with 'dd' instead. * DLLs for OpenSSL 0.9.7. ### Version 4.03, 2002.10.27, urgency: HIGH * NT Service (broken since 4.01) is operational again. * Memory leak in FORK environments fixed. * sigprocmask() mistake corrected. * struct timeval is reinitialized before select(). * EAGAIN handled in client.c for AIX. * Manual page updated. ### Version 4.02, 2002.10.21, urgency: HIGH * Serious bug in ECONNRESET handling fixed. ### Version 4.01, 2002.10.20, urgency: MEDIUM * New features - OpenVMS support. - Polish manual and some manual updates. - 'service' option added on Win32 platform. - Obsolete FAQ has been removed. - Log file is created with 0640 mode. - exec->connect service sections (need more testing). * Bugfixes - EINTR ingored in main select() loop. - Fixed problem with stunnel closing connections on TIMEOUTclose before all the data is sent. - Fixed EWOULDBLOCK on writesocket problem. - Potential DOS in Win32 GUI fixed. - Solaris compilation problem fixed. - Libtool configuration problems fixed. - Signal mask is cleared just before exec in local mode. - Accepting sockets and log file descriptors are no longer leaked to the child processes. ### Special thanks to Steve Grubb for the source code audit. ### Version 4.00, 2002.08.30, urgency: LOW * New features sponsored by MAXIMUS http://www.maximus.com/ - New user interface (config file). - Single daemon can listen on multiple ports, now. - Native Win32 GUI added. - Native NT/2000/XP service added. - Delayed DNS lookup added. * Other new features - All the timeouts are now configurable including TIMEOUTclose that can be set to 0 for MSIE and other buggy clients that do not send close_notify. - Stunnel process can be chrooted in a specified directory. - Numerical values for setuid() and setgid() are allowed, now. - Confusing code for setting certificate defaults introduced in version 3.8p3 was removed to simplify stunnel setup. There are no built-in defaults for CApath and CAfile options. - Private key file for a certificate can be kept in a separate file. Default remains to keep it in the cert file. - Manual page updated. - New FHS-compatible build system based on automake and libtool. * Bugfixes - `SSL socket closed on SSL_write' problem fixed. - Problem with localtime() crashing Solaris 8 fixed. - Problem with tcp wrappers library detection fixed. - Cygwin (http://www.cygwin.com/) support added. - __svr4__ macro defined for Sun C/C++ compiler. * DLLs for OpenSSL 0.9.6g. ### Version 3.22, 2001.12.20, urgency: HIGH * Format string bug fixed in protocol.c smtp, pop3 and nntp in client mode were affected. (stunnel clients could be attacked by malicious servers) * Certificate chain can be supplied with -p option or in stunnel.pem. * Problem with -r and -l options used together fixed. * memmove() instead of memcpy() is used to move data in buffers. * More detailed information about negotiated ciphers is printed. * New ./configure options: '--enable-no-rsa' and '--enable-dh'. ### Version 3.21c, 2001.11.11, urgency: LOW * autoconf scripts upgraded to version 2.52. * Problem with pthread_sigmask on Darwin fixed (I hope). * Some documentation typos corrected. * Attempt to ignore EINTR in transfer(). * Shared library version reported on startup. * DLLs for OpenSSL 0.9.6b. ### Version 3.21b, 2001.11.03, urgency: MEDIUM * File descriptor leak on failed connect() fixed. ### Version 3.21a, 2001.10.31, urgency: MEDIUM * Small bug in Makefile fixed. ### Version 3.21, 2001.10.31, urgency: MEDIUM * Problem with errno and posix threads fixed. * It is assumed that system has getopt() if it has getopt.h header file. * SSL_CLIENT_DN and SSL_CLIENT_I_DN environment variables set in local mode (-l) process. This feature doesn't work if client mode (-c) or protocol negotiation (-n) is used. * Winsock error descriptions hardcoded (English version only). * SetConsoleCtrlHandler() used to handle CTRL+C, logoff and shutdown on Win32. * Stunnel always requests peer certificate with -v 0. * sysconf()/getrlimit() used to calculate number of clients allowed. * SSL mode changed for OpenSSL >= 0.9.6. * close-on-exec option used to avoid socket inheriting. * Buffer size increased from 8KB to 16KB. * fdscanf()/fdprintf() changes: - non-blocking socket support, - timeout after 1 minute of inactivity. * auth_user() redesigned to force 1 minute timeout. * Some source arrangement towards 4.x architecture. * No need for 'goto' any more. * New Makefile 'test' rule. It performs basic test of standalone/inetd, remote/local and server/client mode. * pop3 server mode support added. ### Version 3.20, 2001.08.15, urgency: LOW * setsockopt() optlen set according to the optval for Solaris. * Minor NetBSD compatibility fixes by Martti Kuparinen. * Minor MSVC 6.0 compatibility fixes by Patrick Mayweg. * SSL close_notify timeout reduced to 10 seconds of inactivity. * Socket close instead of reset on close_notify timeout. * Some source arrangement and minor bugfixes. ### Version 3.19, 2001.08.10, urgency: MEDIUM * Critical section added around non MT-safe TCP Wrappers code. * Problem with 'select: Interrupted system call' error fixed. * errno replaced with get_last_socket_error() for Win32. * Some FreeBSD/NetBSD patches to ./configure from Martti Kuparinen. * Local mode process pid logged. * Default FQDN (localhost) removed from stunnel.cnf * ./configure changed to recognize POSIX threads library on OSF. * New -O option to set socket options. ### Version 3.18, 2001.07.31, urgency: MEDIUM * MAX_CLIENTS is calculated based on FD_SETSIZE, now. * Problems with closing SSL in transfer() fixed. * -I option to bind a static local IP address added. * Debug output of info_callback redesigned. ### Version 3.17, 2001.07.29, urgency: MEDIUM * Problem with GPF on exit with active threads fixed. * Timeout for transfer() function added: - 1 hour if socket is open for read - 1 minute if socket is closed for read ### Version 3.16, 2001.07.22, urgency: MEDIUM * Some transfer() bugfixes/improvements. * STDIN/STDOUT are no longer assumed to be non-socket descriptors. * Problem with --with-tcp-wrappers patch fixed. * pop3 and nntp support bug fixed by Martin Germann. * -o option to append log messages to a file added. * Changed error message for SSL error 0. ### Version 3.15, 2001.07.15, urgency: MEDIUM * Serious bug resulting in random transfer() hangs fixed. * Separate file descriptors are used for inetd mode. * -f (foreground) logs are now stamped with time. * New ./configure option: --with-tcp-wrappers by Brian Hatch. * pop3 protocol client support (-n pop3) by Martin Germann. * nntp protocol client support (-n nntp) by Martin Germann. * RFC 2487 (smtp STARTTLS) client mode support. * Transparency support for Tru64 added. * Some #includes for AIX added. ### Version 3.14, 2001.02.21, urgency: LOW * Pidfile creation algorithm has been changed. ### Version 3.13, 2001.01.25, urgency: MEDIUM * pthread_sigmask() argument in sthreads.c corrected. * OOB data is now handled correctly. ### Version 3.12, 2001.01.24, urgency: LOW * Attempted to fix problem with zombies in local mode. * Patch for 64-bit machines by Nalin Dahyabhai applied. * Tiny bugfix for OSF cc by Dobrica Pavlinusic added. * PORTS file updated. ### Version 3.11, 2000.12.21, urgency: MEDIUM * New problem with zombies fixed. * Attempt to be integer-size independent. * SIGHUP handler added. ### Version 3.10, 2000.12.19, urgency: MEDIUM * Internal thread synchronization code added. * libdl added to stunnel dependencies if it exists. * Manpage converted to sdf format. * stunnel deletes pid file before attempting to create it. * Documentation updates. * -D option now takes [facility].level as argument. 0-7 still supported. * Problems with occasional zombies in FORK mode fixed. * 'stunnel.exe' rule added to Makefile. You can cross-compile stunnel.exe on Unix, now. I'd like to be able to compile OpenSSL this way, too... ### Version 3.9, 2000.12.13, urgency: HIGH * Updated temporary key generation: - stunnel is now honoring requested key-lengths correctly, - temporary key is changed every hour. * transfer() no longer hangs on some platforms. Special thanks to Peter Wagemans for the patch. * Potential security problem with syslog() call fixed. ### Version 3.8p4, 2000.06.25 bri@stunnel.org: * fixes for Windows platform ### Version 3.8p3, 2000.06.24 bri@stunnel.org: * Compile time definitions for the following: --with-cert-dir --with-cert-file --with-pem-dir --enable-ssllib-cs * use daemon() function instead of daemonize, if available * fixed FreeBSD threads checking (patch from robertw@wojo.com) * added -S flag, allowing you to choose which default verify sources to use * relocated service name output logging until after log_open. (no longer outputs log info to inetd socket, causing bad SSL) * -V flag now outputs the default values used by stunnel * Removed DH param generation in Makefile.in * Moved stunnel.pem to sample.pem to keep people from blindly using it * Removed confusing stunnel.pem check from Makefile. * UPGRADE NOTE: this version seriously changes several previous stunnel default behaviours. There are no longer any default cert file/dirs compiled into stunnel, you must use the --with-cert-dir and --with-cert-file configure arguments to set these manually, if desired. Stunnel does not use the underlying ssl library defaults by default unless configured with --enable-ssllib-cs. Note that these can always be enabled at run time with the -A,-a, and -S flags. Additionally, unless --with-pem-dir is specified at compile time, stunnel will default to looking for stunnel.pem in the current directory. ### Version 3.8p2, 2000.06.13 bri@stunnel.org: * Fixes for Win32 platform * Minor output formatting changes * Fixed version number in files ### Version 3.8p1, 2000.06.11 bri@stunnel.org: * Added rigorous PRNG seeding * PID changes (and related security-fix) * Man page fixes * Client SSL Session-IDs now used * -N flag to specify tcpwrapper service name ### Version 3.8, 2000.02.24: * Checking for threads in c_r library for FreeBSD. * Some compatibility fixes for Ultrix. * configure.in has been cleaned up. Separate directories for SSL certs and SSL libraries/headers are no longer supported. SSL ports maintainers should create softlinks in the main openssl directory if necessary. * Added --with-ssl option to specify SSL directory. * Added setgid (-g) option. (Special thanks to Brian Hatch for his feedback and support) * Added pty.c based on a Public Domain code by Tatu Ylonen * Distribution files are now signed with GnuPG ### Version 3.7, 2000.02.10: * /usr/pkg added to list of possible SSL directories for pkgsrc installs of OpenSSL under NetBSD. * Added the -s option, which setuid()s to the specified user when running in daemon mode. Useful for cyrus imapd. (both based on patch by George Coulouris) * PTY code ported to Solaris. The port needs some more testing. * Added handler for SIGINT. * Added --with-random option to ./configure script. * Fixed some problems with autoconfiguration on Solaris and others. It doesn't use config.h any more. * /var/run changed to @localstatedir@/stunnel for better portability. The directory is chmoded a=rwx,+t. * FAQ has been updated. ### 3.6 2000.02.03 * Automatic RFC 2487 detection based on patch by Pascual Perez and Borja Perez. * Non-blocking sockets not used by default. * DH support is disabled by default. * (both can be enabled in ssl.c) ### 3.5 2000.02.02 * Support for openssl 0.9.4 added. * /usr/ssl added to configure by Christian Zuckschwerdt. * Added tunneling for PPP through the addition of PTY handling. * Added some documentation. ### 3.4a 1999.07.13 (bugfix release) * Problem with cipher negotiation fixed. * setenv changed to putenv. ### 3.4 1999.07.12 * Local transparent proxy added with LD_PRELOADed shared library. * DH code rewritten. * Added -C option to set cipher list. * stderr fflushed after fprintf(). * Minor portability bugfixes. * Manual updated (but still not perfect). ### 3.3 1999.06.18 * Support for openssl 0.9.3 added. * Generic support for protocol negotiation added (protocol.c). * SMTP protocol negotiation support for Netscape client added. * Transparent proxy mode (currently works on Linux only). * SO_REUSEADDR enabled on listening socket in daemon mode. * ./configure now accepts --prefix parameter. * -Wall is only used with gcc compiler. * Makefile.in and configure.in updated. * SSL-related functions moved to a separate file. * vsprintf changed to vsnprintf in log.c on systems have it. * Pidfile in /var/run added for daemon mode. * RSAref support fix (not tested). * Some compatibility fixes for Solaris and NetBSD added. ### 3.2 1999.04.28 * RSAref support (not tested). * Added full duplex with non-blocking sockets. * RST sent instead of FIN on peer error (on error peer socket is reset - not just closed). * RSA temporary key length changed back to 512 bits to fix a problem with Netscape. * Added NO_RSA for US citizens having problems with patents. ### 3.1 1999.04.22 * Changed -l syntax (first argument specified is now argv[0]). * Fixed problem with options passed to locally executed daemon. * Fixed problem with ':' passed to libwrap in a service name: - ':' has been changed to '.'; - user can specify his own service name as an argument. * RSA temporary key length changed from 512 to 1024 bits. * Added safecopy to avoid buffer overflows in stunnel.c. * Fixed problems with GPF after unsuccessful resolver call and incorrect parameters passed to getopt() in Win32. * FAQ updated. ### 3.0 1999.04.19 * Some bugfixes. * FAQ added. ### 3.0b7 1999.04.14 * Win32 native port fixed (looks quite stable). * New transfer() function algorithm. * New 'make cert' to be compatible with openssl-0.9.2b. * Removed support for memory leaks debugging. ### 3.0b6 1999.04.01 * Fixed problems with session cache (by Adam). * Added client mode session cache. * Source structure, autoconf script and Makefile changed. * Added -D option to set debug level. * Added support for memory leaks debugging (SSL library needs to be compiled with -DMFUNC). ### 3.0b5 1999.03.25 * Lots of changes to make threads work. * Peer (client and server) authentication works! * Added -V option to display version. ### 3.0b4 1999.03.22 * Early POSIX threads implementation. * Work on porting to native Win32 application started. ### 3.0b3 1999.03.05 * Improved behavior on heavy load. ### 3.0b2 1999.03.04 * Fixed -v parsing bug. ### 3.0b1 1999.01.18 * New user interface. * Client mode added. * Peer certificate verification added (=strong authentication). * Win32 port added. * Other minor problems fixed. ### 2.1 1998.06.01 * Few bugs fixed. ### 2.0 1998.05.25 * Remote mode added! * Standalone mode added! * tcpd functionality added by libwrap utilization. * DH callbacks removed by kravietZ. * bind loopback on Intel and other bugs fixed by kravietZ. * New manual page by kravietZ & myself. ### 1.6 1998.02.24 * Linux bind fix. * New TODO ideas! ### 1.5 1998.02.24 * make_sockets() implemented with Internet sockets instead of Unix sockets for better compatibility. (i.e. to avoid random data returned by getpeername(2)) This feature can be disabled in stunnel.c. ### 1.4 1998.02.16 * Ported to HP-UX, Solaris and probably other UNIXes. * Autoconfiguration added. ### 1.3 1998.02.14 * Man page by Pawel Krawczyk added! * Copyrights added. * Minor errors corrected. ### 1.2 1998.02.14 * Separate certificate for each service added. * Connection logging support. ### 1.1 1998.02.14 * Callback functions added by Pawel Krawczyk . ### 1.0 1998.02.11 * First version with SSL support - special thx to Adam Hernik . ### 0.1 1998.02.10 * Testing skeleton. stunnel-5.74/TODO.md0000644000175000001440000000360514616436666007733 # stunnel TODO ### Updated defaults planned for stunnel 6.xx More secure defaults planned for the next major version. * OCSPaia = yes * verifyPeer = yes (on the client) ### High priority features These features will likely be supported some day. A sponsor could allocate my time to get them faster. * Add client certificate autoselection based on the list of accepted issuers: SSL_CTX_set_client_cert_cb(), SSL_get_client_CA_list(). * OCSP stapling (tlsext_status). * Indirect CRL support (RFC 3280, section 5). * Add an Apparmor profile. * Log rotation on Windows. * Configuration file option to limit the number of concurrent connections. * Command-line server control interface on Unix. * An Android GUI. * MSI installer for Windows. * Add 'leastconn' failover strategy to order defined 'connect' targets by the number of active connections. * MariaDB (formerly MySQL) protocol negotiation: [MariaDB Handshake Protocol](https://mariadb.com/kb/en/connection/) ### Low priority features These features will unlikely ever be supported. * Database and/or directory interface for retrieving PSK secrets. * Service-level logging destination. * Logging to NT EventLog on Windows. * Internationalization of logged messages (i18n). * Generic scripting engine instead or static protocol.c. ### Rejected features Features I will not support, unless convinced otherwise by a wealthy sponsor. * Support for adding X-Forwarded-For to HTTP request headers. This feature is less useful since PROXY protocol support is available. * Support for adding X-Forwarded-For to SMTP email headers. This feature is most likely to be implemented as a separate proxy. * Additional certificate checks (including wildcard comparison) based on: - O (Organization), and - OU (Organizational Unit). * Set processes title that appear on the ps(1) and top(1) commands. I could not find a portable *and* non-copyleft library for it. stunnel-5.74/doc/0000755000175000001440000000000014727063631007454 5stunnel-5.74/doc/en/0000775000175000001440000000000012641244223010047 5stunnel-5.74/doc/en/PKCS#11-notes.txt0000664000175000001440000000071412641244223012625 Based on https://github.com/OpenSC/OpenSC/wiki/SmartCardHSM Create a keypair: pkcs11-tool --module /usr/local/lib/opensc-pkcs11.so --login --pin 123456 --id 05 --keypairgen --key-type EC:prime256v1 --label ecc Save the public key: pkcs11-tool --module /usr/local/lib/opensc-pkcs11.so -l --pin 123456 --id 05 --read-object --type pubkey --output-file pubkey.spki Delete the private key: pkcs11-tool -l --pin 123456 --delete-object --type privkey --id 05 stunnel-5.74/doc/en/VNC_StunnelHOWTO.html0000664000175000001440000002035612540017430013636

VNC over STUNNEL with a Linux server and Windows 2000 client HOWTO


19 February 2001

ver 1.0

by Craig Furter and Arno van der Walt

contact us at cfurter@vexen.co.za and arnovdw@mycomax.com



We assume that you have already downloaded VNCServer and VNCViewer.


First of all there is a step by step HOWTO and then we'll look at the theory behind all this.


  1. Download and install OpenSSL, SSLeay, and Stunnel on the Linux/Unix box. Download the modules.

a) [root@anthrax$]gunzip openssl-x.xx.tar.gz (repeat for all 3 the modules)

b) [root@anthrax$]tar – xvf openssl-x.xx.tar (repeat for all 3 the modules)


  1. Copy the following to Notepad and save the file as VNCRegEdit.REG on the Windows 2000 box

--cut here and copy to VNCRegEdit.REG then double click the file to import--
REGEDIT4

[HKEY_LOCAL_MACHINE\Software\ORL\WinVNC3]
AllowLoopback=dword:00000001

[HKEY_LOCAL_MACHINE\Software\ORL\WinVNC3\Default]
AllowLoopback=dword:00000001
--stop here--


  1. Install Stunnel on the Windows 2000 machine by copying the following files to your \WINNT\SYSTEM32\ directory

a)libeay32.dll

b)libssl.dll

c)stunnel.pem


  1. On the Linux box execute the following command as root and let it run in its own terminal.

./stunnel -d 5900 -r 5901


  1. Execute vncserver (it should run as display:1 when you execute the ps aux |grep vnc command)


  1. Now on the Windows 2000 machine execute the following command and let it run in its own terminal.

stunnel -d 5900 -r unix.ip.address:5900 -c

.

  1. And on the Windows 2000 machine open VNCviewer and connect to localhost specifying no display

ie. 10.10.1.53 in the window


  1. For each additional display repeat steps 4 – 6 and increment the specified ports with 2 ie. The Linux command will look as follows:

./stunnel -d 5902 -r 5903

and the Windows 2000 command as follows:

stunnel -d 5902 -r unix.ip.address:5902

and remember to start another vncserver on the Linux box for each VNC display



  1. The display number on the vncviewer must also be incremented with two ie:

10.10.1.53:2 etc.


The THEORY


Tunneling:


What this means is that software (daemon) runs on the client and server machine. In this case, the Windows 2000 machine is the client and the server is the *NIX machine. Stunnel will then run as client on Windows 2000 and server mode on the UNIX box.

eg:
Windows:
stunnel -d 5900 -r unix.ip.address:5900 -c

UNIX
stunnel -d 5900 -r 5901

This means that connecting to VNC display 0 in the localhost will transfer all the calls to the *NIX machine on display 1. So the VNC server on the *NIX machine must be running on display 1. Not display 0. If you run stunnel before VNC, VNC will automatically move to display 1 noticing that port 5900 ("display" 0) is already in use).

What happens now is that when you connect to port 5900 on the Windows machine via an "unsecured" connection, a secure "tunnel" is opened from Windows 2000 to the *NIX machine on port 5900. The *NIX machine then opens a "unsecured" connection to itself on port 5901. We now have a secure tunnel available.


A bit about VNC and displays


The -d is the listening IPaddress:port and the -r is the remote IPaddress:port. VNC uses port 5900 for display 0. That means that display 1 will be 5901. If you want VNC server to listen for a connection on port 80 then the display number will be 80 - 5900 = -5820. If you want VNC server to
listen on port 14000 then the display number is 14000 - 5900 = 8100.

So all you have to do is run stunnel on the UNIX machine and VNC on the desired "display" number.


VNC on the Windows 2000 machine


To connect from the client machine you need to enter the client machine's IP address and the "display" (from the port conversion). But VNC will think that you are trying to connect to the local machine and does not allow this. To override this add the following to your registry.

--cut here and copy to anything.reg. then double click the file to import--
REGEDIT4

[HKEY_LOCAL_MACHINE\Software\ORL\WinVNC3]
AllowLoopback=dword:00000001

[HKEY_LOCAL_MACHINE\Software\ORL\WinVNC3\Default]
AllowLoopback=dword:00000001
--stop here--

Now VNC will not complain. So you need to always run stunnel in client mode on the Windows machine and then connect with VNCViewer to the localhost on the correct "display". By the way, *NIX doesn't complain about this. There is no setting needed if *NIX to *NIX.


VNC's Java client


Unfortunately this will not work well with the built-in web version. If you did not known about it, try http'ing into a machine running VNC server on it, to port 58XX (where XX is the display number), and the Java client will be loaded.

stunnel-5.74/doc/pl/0000775000175000001440000000000012540017430010054 5stunnel-5.74/doc/pl/faq.stunnel-2.html0000664000175000001440000001171412477533506013303 Gdy pojawiaj si kopoty Q: Prbuje kompilowa stunnel jednak dostaje nastpujce komunikaty:
stunnel.c:69: ssl.h: No such file or directory
stunnel.c:71: bio.h: No such file or directory
stunnel.c:72: pem.h: No such file or directory
make: *** [stunnel.o] Error 1

A: S dwie prawdopodobne przyczyny: nie masz zainstalowanego w systemie pakietu SSLeay lub pakiet nie znajduje sie w miejscu domylnym czyli /usr/local/ssl. Naley zainstalowa SSLeay lub te poprawi Makefile tak by cieka bya prawidowa.



Q:  Prbuje uruchomi stunnel jako wrapper dla httpd. Po wydaniu komendy: stunnel 443 @localhost:80 demon si nie uruchamia a w syslogu pojawia si komunikat "stunnel[2481]: getpeername: Socket operation on non-socket (88)"

A: Jest to bd charakterystyczny dla Linuxa. Naley w pliku stunnel.c zmieni lini #define INET_SOCKET_PAIR 1 na
#define INET_SOCKET_PAIR 0 i zrekompilowa program ponownie.



Q: Stunnel nadal si nie uruchamia a w syslogu pojawia si komunikat "stunnel[2525]: /usr/local/ssl/certs/localhost:80.pem: No such file or directory (2)"

A: Nie posiadasz odpowiedniego certyfikatu dla demona. Stunnel w celu poprawnego dziaania MUSI posiada certyfikat. W celu wygenerowania odpowiedniego certyfikatu naley wyda komende: /usr/local/ssl/bin/ssleay req -new -x509 -nodes -out server.pem -days 365 -keyout server.pem  bd te uy Makefile doczonego do programu stunnel i przy pomocy komendy make cert stworzy certyfikat. Tak utworzony certyfikat (server.pem) naley umieci w katalogu /usr/local/ssl/certs i utworzy do odpowiednie linki lub zmie nazw certyfikatu na wymagan przez stunnel.



Q: Wygenerowaem odpowiedni certyfikat przy pomocy skryptu CA.sh, a stunnel przy starcie prosi o podanie hasa. Jak mona przekaza haso zabezpieczajce certyfikat do programu ?

A: W chwili obecnej jest to niemoliwe. Certyfikaty ktrymi posuguje sie stunnel nie mog by zabezpieczane hasem. Przy tworzeniu certyfikatu naley uy opcji -nodes (lub utworzy certyfikat przy pomocy makefile odstarczonego z programem).



Q: Po uruchomieniu programu stunnel w syslogu pojawia si komunikat: "stunnel[2805]: WARNING: Wrong permissions on /usr/local/ssl/certs/localhost:80.pem". Co jest nie tak ?

A: To tylko ostrzeenie ! Certyfikat nie powien da si odczyta przez innych uytkownikw systemu. Prawidowe prawa dostpu powinny by nastpujce: -rw------   1 root     root         1370 Nov 8 1997  server.pem (jeli uruchamiajcym stunnel jest root).



Q: Probowaem zrobi tunelowanie poczenia do demona pop3. Pomimo zrobienia prawidowego wpisu do inetd.conf
"spop3  stream  tcp  nowait  root  /usr/sbin/stunnel  qpopper -s" stunnel nie dziaa a w syslogu pojawia si komunikat:
inetd[2949]: spop3/tcp: unknown service.

A: Nie zrobie dodatkowych wpisw do pliku /etc/services. Zgodnie z rfc???? prawidowymi portami na ktrych dziaaj demony posugujce si SSL s:
https 443/tcp # HTTP over SSL 
ssmtp 465/tcp # SMTP over SSL 
snews 563/tcp # NNTP over SSL 
ssl-ldap 636/tcp # LDAP over SSL 
simap 993/tcp # IMAP over SSL 
spop3 995/tcp # POP-3 over SSL 
Jeli nie chesz robi poprawek zamiast nazwy serwisu uyj numeru portu na ktrym on dziaa.



Q: Dobrze, zrobiem wymagany wpis lecz w dalszym ciagu stunnel nie dziaa, natomiast w syslogu pojawia sie wpis:
 stunnel[3015]: execvp: No such file or directory (2). Co jeszcze jest nie tak ?

A:  Prawdopodone s dwie przyczyny: pierwsza w twoim systemie nie ma demona dla ktorego zrobie wpis w inetd.conf,
(spop3  stream  tcp  nowait  root  /usr/sbin/stunnel  qpopper -s) lub te dany program jest w systemie, jednak cieka dostpu do niego nie jest wymieniona w zmiennej systemowej $PATH. Naley wic poprawi zapis w inetd.conf uzupeniajc o pena cieke dostpu do demona np.  spop3  stream  tcp  nowait  root  /usr/sbin/stunnel  /usr/sbin/qpopper -s
 
  stunnel-5.74/doc/pl/tworzenie_certyfikatow.html0000664000175000001440000010701012540017430015502 Wszystko co powiniene wiedzie o tworzeniu certyfikatw ale nie chce Ci si poszuka w dokumentacji

Wszystko co powiniene wiedzie o tworzeniu certyfikatw ale nie chce Ci si

poszuka w dokumentacji.

 

Co powinno znajdowa si na Twoim dysku zamin zostaniesz "Certificate Authorities".

Podstawowym oprogramowaniem jest oczywicie openssl. W tym miejscu naley zachowa czujno
bo openssl MUSI by co najmniej w wersji 0.9.2b dziki czemu ominie Ci cz karkoomnych
operacji przy pomocy pcks12 ktory take musisz posiada w swoich zasobach dyskowych.
Jeli masz ju zainstalowane powysze oprogramowanie moesz zacz tworzy certyfikaty.

Konfiguracja openssl.

Zakadam ze openssl jest zainstalowany standardowo czyli w /usr/local/ssl. Pierwszym krokiem jest
przejrzenie i "dokonfigurowanie" /usr/local/ssl/lib/openssl.cnf. Mj domowy konfig wyglda nastpujco
(kolorem czerwonym zaznaczylem opcje ktre raczej powiniene zmieni) :
jeli nie chce Ci si tego czyta to skocz na koniec konfiga

#
# OpenSSL example configuration file.
# This is mostly being used for generation of certificate requests.
#
 
RANDFILE                = $ENV::HOME/.rnd
oid_file                = $ENV::HOME/.oid
oid_section             = new_oids
 
[ new_oids ]
 
# We can add new OIDs in here for use by 'ca' and 'req'.
# Add a simple OID like this:
# testoid1=1.2.3.4
# Or use config file substitution like this:
# testoid2=${testoid1}.5.6
 
####################################################################
[ ca ]
default_ca      = CA_default            # The default ca section
 
####################################################################
[ CA_default ]
 
dir             = ./demoCA              # Where everything is kept
certs           = $dir/certs            # Where the issued certs are kept
crl_dir         = $dir/crl              # Where the issued crl are kept
database        = $dir/index.txt        # database index file.
new_certs_dir   = $dir/newcerts         # default place for new certs.
 
certificate     = $dir/cacert.pem       # The CA certificate
serial          = $dir/serial           # The current serial number
crl             = $dir/crl.pem          # The current CRL
private_key     = $dir/private/cakey.pem# The private key
RANDFILE        = $dir/private/.rand    # private random number file
 
x509_extensions = usr_cert              # The extensions to add to the cert
crl_extensions  = crl_ext               # Extensions to add to CRL
default_days    = 365                   # how long to certify for
default_crl_days= 30                    # how long before next CRL
default_md      = md5                   # which md to use.
preserve        = no                    # keep passed DN ordering
 
# A few difference way of specifying how similar the request should look
# For type CA, the listed attributes must be the same, and the optional
# and supplied fields are just that :-)
policy          = policy_match
# For the CA policy
[ policy_match ]
countryName             = match
stateOrProvinceName     = match
organizationName        = match
organizationalUnitName  = optional
commonName              = supplied
emailAddress            = optional
 
# For the 'anything' policy
# At this point in time, you must list all acceptable 'object'
# types.
[ policy_anything ]
countryName             = optional
stateOrProvinceName     = optional
localityName            = optional
organizationName        = optional
organizationalUnitName  = optional
commonName              = supplied
emailAddress            = optional
 
####################################################################
[ req ]
default_bits             = 1024
default_keyfile         = privkey.pem
distinguished_name      = req_distinguished_name
attributes                      = req_attributes
x509_extensions = v3_ca # The extensions to add to the self signed cert
 
[ req_distinguished_name ]
countryName                     = Country Name (2 letter code)
countryName_default             = PL
countryName_min                  = 2
countryName_max                 = 2
 
stateOrProvinceName                  = State i Prowincja
stateOrProvinceName_default     = State-Prowincja domyslna
localityName                         = Locality Name (eg, city)
localityName_default            = Lodz
 
0.organizationName                   = Organization Name (eg, company)
0.organizationName_default      = Nawza Organizacji
 
# we can do this but it is not needed normally :-)
#1.organizationName             = Second Organization Name (eg, company)
#1.organizationName_default     = World Wide Web Pty Ltd
organizationalUnitName               = Organizational Unit Name (eg, section)
organizationalUnitName_default  = Unit name domyslny
 
commonName                      = Common Name (eg, YOUR name)
commonName_max                  = 64
 
emailAddress                    = Email Address
emailAddress_max           = 40
 
# SET-ex3                       = SET extension number 3
 
[ req_attributes ]
challengePassword               = A challenge password
challengePassword_min       = 4
challengePassword_max       = 20
 
unstructuredName                = An optional company name
 
[ usr_cert ]
 
# These extensions are added when 'ca' signs a request.
 
# This goes against PKIX guidelines but some CAs do it and some software
# requires this to avoid interpreting an end user certificate as a CA.
 
basicConstraints=CA:FALSE
 
# Here are some examples of the usage of nsCertType. If it is omitted
# the certificate can be used for anything *except* object signing.
 
# This is OK for an SSL server.
#nsCertType                     = server
 
# For an object signing certificate this would be used.
#nsCertType = objsign
 
# For normal client use this is typical
nsCertType = client, email
 
# This is typical also
 
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
 
nsComment                       = "OpenSSL Generated Certificate"
 
# PKIX recommendations
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid,issuer:always
# Import the email address.
 
subjectAltName=email:copy
 
# Copy subject details
 
issuerAltName=issuer:copy
 
#nsCaRevocationUrl              = http://www.domain.dom/ca-crl.pem
#nsBaseUrl
#nsRevocationUrl
#nsRenewalUrl
#nsCaPolicyUrl
#nsSslServerName
 
[ v3_ca]
 
# Extensions for a typical CA
 
# It's a CA certificate
basicConstraints = CA:true
 
# PKIX recommendation.
 
subjectKeyIdentifier=hash
 
authorityKeyIdentifier=keyid:always,issuer:always
 
# This is what PKIX recommends but some broken software chokes on critical
# extensions.
#basicConstraints = critical,CA:true
 
# Key usage: again this should really be critical.
keyUsage = cRLSign, keyCertSign
 
# Some might want this also
nsCertType = sslCA, emailCA, objCA
 
# Include email address in subject alt name: another PKIX recommendation
subjectAltName=email:copy
# Copy issuer details
issuerAltName=issuer:copy
 
# RAW DER hex encoding of an extension: beware experts only!
# 1.2.3.5=RAW:02:03
# You can even override a supported extension:
# basicConstraints= critical, RAW:30:03:01:01:FF
 
[ crl_ext ]
 
# CRL extensions.
# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL.

issuerAltName=issuer:copy
authorityKeyIdentifier=keyid:always,issuer:always
################################################################################
########## koniec pliku openssl.cnf

Jak wida zmiany s praktycznie kosmetyczne.  Naley zwrcic jedynie uwag na opcj default_bits w sekcji req.
W momencie generowania certyfikatu CA powinna mie ona warto 1024 lub wicej, natomiast w trakcie tworzenia
certyfikatw klienckich winno mie si na uwadze wredn cech produktw M$ dostpnych poza granicami USA.
Nie s one w stanie zaimportowa kluczy majcych wicej ni 512 bitw. W takim przypadku default_bits naley
zmniejszy do tej wartoci. Jeli chodzi o Netscapa konieczno taka nie wystpuje, nawet gdy nie jest on
patchowany przy pomocy Fortify. Jednake klucz nie powinien by wikszy ni 1024 bity.

Generowanie certyfikatu CA

Pierwszy czynnoci jak naley wykona jest wygenerowanie certyfikatu CA czyli czego czym bd
podpiswane certyfikaty udostpniane klientom. Uruchom rxvt lub co innego i wykonaj polecenie:

adas:~# cd /usr/local/ssl/bin
adas:/usr/local/ssl/bin# ./CA.pl -newca

CA certificate filename (or enter to create)

Making CA certificate ...
Using configuration from /usr/local/ssl/lib/openssl.cnf
Generating a 1024 bit RSA private key
..+++++
....+++++
writing new private key to './demoCA/private/cakey.pem'
Enter PEM pass phrase:
Verifying password - Enter PEM pass phrase:
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [PL]:
State i Prowincja [Kraina Bezrobotnych Szwaczek]:
Locality Name (eg, city) [Lodz]:
Organization Name (eg, company) [Instytut Badan Czarow i Magii]:
Organizational Unit Name (eg, section) [Komorka d/s Egzorcyzmow i Opentan]:
Common Name (eg, YOUR name) []:Adam Hernik
Email Address []:adas@infocentrum.com

adas:/usr/local/ssl/bin#

Skrypt CA.pl uruchomiony poraz pierwszy tworzy w /usr/local/ssl/bin katalog o nazwie demoCA w ktrym znajduje si
wygenerowany przed chwil certyfikat publiczny cacert.pem (doczany pniej do certyfikatw klienckich) oraz tajny
zabezpieczony hasem klucz cakey.pem ktrym bdziesz podpisywa certyfikaty wydawane uytkownikom. Klucz i haso
oczywicie naley dobrze chroni i najlepiej jest gdy znajduje si na serwerze tylko w momencie generowania certyfikatu.
Ponowne uruchomienie CA.pl z parametrem -newca niszczy to co pracowicie stworzye i generuje nowy klucz i certyfikat.
 

Tworzenie certyfikatu dla stunnela i innych serwerw
 

Zanim si do tego zabierzesz powiniene lekko zmodyfikowac skrypt CA.pl oraz plik konfiguracyjny openssl.cnf.
Skopiuj je odpowiednio do plikw /usr/local/ssl/bin/CAserv.pl i /usr/local/ssl/lib/openssl_serv.cnf.
Generowane certyfikaty domylnie zabezpieczone s hasem, w takim przypadku w momencie startu stunnela zawsze
bdziesz pytany o haslo zabezpieczajce, co skutecznie uniemoliwi automatyczne uruchamianie programu w czasie
bootowania  serwera, czy te przy prbie wystartowania go przez inetd. Naley poprawi linie 40 i 41 skryptu
CAserv.pl z

linia 40:
$REQ="openssl req $SSLEAY_CONFIG";
na
$REQ="openssl req -nodes -config /usr/local/ssl/lib/openssl_serv.cnf";

linia 41:
$CA="openssl ca $SSLEAY_CONFIG";
na
$CA="openssl ca -config /usr/local/ssl/lib/openssl_serv.cnf";
 

Natomiast w pliku /usr/local/ssl/lib/openssl_serv.cnf nalezy  w sekcji usr_cert "zahashowa" linijk
nsCertType = client, email  oraz "odhashowa" linijk nsCertType   = server . Jeli tego nie zrobisz klient nie bdzie
poprawnie rozpoznawa typu certyfikatu. A teraz kolej na wygenerowanie "requestu" posyanego zazwyczaj do CA.
Bdc w katalogu /usr/local/ssl/bin wykonaj:

adas:/usr/local/ssl/bin# ./CAserv.pl -newreq
Using configuration from /usr/local/ssl/lib/openssl_serv.cnf
Generating a 1024 bit RSA private key
..............................+++++
.........+++++
writing new private key to 'newreq.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [PL]:
State i Prowincja [Kraina Bezrobotnych Szwaczek]:Kraina latajacych scyzorykow
Locality Name (eg, city) [Lodz]:Sielpia
Organization Name (eg, company) [Instytut Badan Czarow i Magii]:Bar Sloneczko
Organizational Unit Name (eg, section) [Komorka d/s Egzorcyzmow i Opentan]:Kuflownia
Common Name (eg, YOUR name) []:adas.pl
Email Address []:adas@adas.pl

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
Request (and private key) is in newreq.pem
adas:/usr/local/ssl/bin#

Polem o ktrym warto wspomnie jest "Common Name" (zaznaczone na czerwono). W trakcie generowania requestu
naley w tym miejscu wpisa FQDN serwera na ktrym bdzie on uywany. W przeciwnym wypadku w chwili
poczenia klient bdzie twierdzi, e certyfikat jakim przedstawia si serwer nie naley do niego. Unikniemy w ten
sposb niepotrzebnego klikania. Kolejn czynnoci jest podpisanie wygenerowanego requestu. W katalogu
/usr/local/ssl/bin wykonaj polecenie:

adas:/usr/local/ssl/bin# ./CAserv.pl -sign
Using configuration from /usr/local/ssl/lib/openssl.cnf
Enter PEM pass phrase:
Check that the request matches the signature
Signature ok
The Subjects Distinguished Name is as follows
countryName           :PRINTABLE:'PL'
stateOrProvinceName   :PRINTABLE:'Kraina latajacych scyzorykow'
localityName          :PRINTABLE:'Sielpia'
organizationName      :PRINTABLE:'Bar Sloneczko'
organizationalUnitName:PRINTABLE:'Kuflownia'
commonName            :PRINTABLE:'adas.pl'
emailAddress          :IA5STRING:'adas@adas.pl'
Certificate is to be certified until Mar 26 21:06:13 2000 GMT (365 days)
Sign the certificate? [y/n]:y
 

1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
Signed certificate is in newcert.pem
adas:/usr/local/ssl/bin#

W trakcie podpisywania bdziesz pytany o haso zabezpieczajce klucz prywatny CA (zaznaczone na zielono).
Po tej operacji powiniene w katalogu /usr/local/ssl/bin otrzyma 2 pliki: newcert.pem oraz newreq.pem.
Zanim zaczniesz ich uywa musisz wykona jeszcze jedn operacje, a mianowicie zorzy wszystko do kupy.
Wykonujesz: cat newcert.pem newreq.pem > httpds.pem a nastpnie poddajesz tak powstay certyfikat edycji.
Naley z pliku httpds.pem naley usun wszystkie niepotrzebne informacje tak by pozosta jedynie certyfikat oraz
klucz prywatny. Po tej operacji plik httpds.pem powinien wyglda mniej wicej tak:

issuer :/C=PL/ST=Kraina Bezrobotnych Szwaczek/L=Lodz/O=Instytut Badan Czarow i Magii/OU=Komorka d/s Egzorcyzmow i opentan/CN=Adam Hernik/Email=adas@infocentrum.com
subject:/C=PL/ST=Kraina latajacych scyzorykow/L=Sielpia/O=Bar Sloneczko/OU=Kuflownia/CN=adas.pl/
Email=adas@adas.pl
-----BEGIN CERTIFICATE-----
 Tu s magiczne dane
-----END CERTIFICATE-----

-----BEGIN RSA PRIVATE KEY-----
  I tu te s magiczne dane
-----END RSA PRIVATE KEY-----

Spreparowany w ten sposb plik umieszczamy w katalogu /usr/local/ssl/certs i zajmujemy si generowaniem dwu
certyfikatw klienckich.
 

Generowanie i importowanie certyfikatw klienckich do Netscape Communikatora.
 
Generalnie s dwie metody tworzenia i importowania certyfikatw klienckich do Netscapa
Sposb pierwszy:
Przy pomocy komendy CA.pl -newreq wygeneruj request a nastpnie przy pomocy CA.pl -sign podpisz go.
Pytanie o challenge password zignoruj. Kolejn czynnoci jest scalenie i podczyszczenie certyfikatu.
W przypadku certyfikatu klienta wane jest podanie prawidowego adresu email ! Bez tego nie bdzie mona
podpisywa i szyfrowa listw.  Stwrz dwa certyfikaty. Bd one potrzebne do wyjanienia dziaania opcji -v 3
programu stunnel. Zakadam e pierwszy certyfikat naley do Jana Kowalskiego jan@ibczim.pl zachowany w
pliku jan.pem a drugi do Genowefy Pigwy pigwa@scyzoryki.pl znajdujcym si w pliku pigwa.pem.  Przed
zaimportowaniem plikw do Netscpea naley przekonwertowa je z formatu PEM do PCKS12. Wykonuje si to
przy pomocy wspomnianego na pocztku programu pcks12. Aby przekonwertowa certyfikat Jan Kowalskiego,
w katalogu w ktorym znajduje si plik jan.pem wykonaj:
 

pkcs12 -export -name "Jan Kowalski jan@ibczim.pl" -in jan.pem -out jan.p12 -certfile /usr/local/ssl/bin/demoCA/cacert.pem

(jest to jedna linia !!!)
w wyniku czego powstanie plik jan.p12 ktry mona zaimportowa do Netscapea. Bardzo wan opcj jest
-certfile /usr/local/ssl/bin/demoCA/cacert.pem. Bez niej nie bdzie mona w prawidowy sposb podpisywa listw.
Przecznik -certfile powoduje doczenie publicznego certyfikatu CA do certyfikatu klienta dziki czemu Netscape
jest wstanie "wyekstrachowa" certyfikat CA i doda go do wewntrznej bazy CA. Wykonaj powysz operacj take
dla pigwy. Samo zaimportowanie certyfikatu jest bardzo proste wykonuje si to klikajc w Netscape na

Security-> Yours -> Import a Certificate

Po zaimportowaniu naley w Security -> Signers zaznaczy nasz CA certyfikat a nastpnie klikn na przycisku Edit
oraz "zaczekowa" opcje:

Accept this Certificate Authority for Certifying network sites
Accept this Certificate Authority for Certifying e-mail users

Od tej pory nasz certyfikat bdzie traktowany na rwni z innymi, komercyjnymi.

Sposb drugi:
Polega on na wygenerowaniu i imporcie certyfikatu poprzez strone www. Wraz z stunnelem dostarczane s
przkadowe strony (dwie) i skrypty (dwa).  Skrypty naley raczej traktowa jako wzorzec i kady powinien napisa
swoje, bardziej bezpieczne. Pierwszym krokiem jest import certyfikatu CA. Uywa si do tego strony importCA.html
oraz skryptu importCA.sh. Sam skrypt wyglda tak:

#!/bin/bash

echo "Content-type: application/x-x509-ca-cert"
echo
cat /var/lib/httpds/cgi-bin/cacert.pem

cacert.pem jest to oczywicie certyfikat publiczny CA znajdujcy si w katalogu /usr/local/ssl/bin/demoCA
ktry naley przekopiowa do katalogu cgi-bin serwera httpd oraz nada mu odpowiednie prawa dostpu.
Po zaimportowaniu certyfikatu CA naley w Security->Signers zaznaczy do jakich celw bdziemy uznawli
go za wiarygodny. Do generowania certyfikatu klienta wykorzystamy pozosta strone i skrypt. Zanim do tego dojdzie
naley "dokonfigurowa" skrypt i stworzy potrzebne katalogi.  W /tmp (lub w innym miejscu) nalezy stworzy
katalog ssl a nastpnie przekopiowa do niego katalog /usr/local/bin/demoCA oraz plik openssl.cnf.
Jako e skrypty domylnie uruchamiane s z prawami uytkownika nobody naley uczyni go  wlacicielem
katalogu /tmp/ssl i caej jego zawartoci. Kolejn czynnoci jest wygenerowanie pliku .rnd. W Linuxie robimy to
tak:
cat /dev/random > /tmp/ssl/.rnd
czekamy chwilk tak by plik .rnd mia wielko okoo 1024 B po czym wacicielem pliku robimy uytkownika nobody.
Teraz trzeba przekonfigurowa plik /tmp/ssl/openssl.cnf

#
# OpenSSL example configuration file.
# This is mostly being used for generation of certificate requests.
#
 
RANDFILE                = /tmp/ssl/.rnd
#oid_file                = /tmp/ssl/.oid
oid_section             = new_oids
 
[ new_oids ]
 
# We can add new OIDs in here for use by 'ca' and 'req'.
# Add a simple OID like this:
# testoid1=1.2.3.4
# Or use config file substitution like this:
# testoid2=${testoid1}.5.6

####################################################################
[ ca ]
default_ca      = CA_default            # The default ca section

####################################################################
[ CA_default ]
 
dir             = /tmp/ssl/demoCA               # Where everything is kept
certs           = $dir/certs            # Where the issued certs are kept
crl_dir         = $dir/crl              # Where the issued crl are kept
database        = $dir/index.txt        # database index file.
new_certs_dir   = $dir/newcerts         # default place for new certs.
 
Naley zmieni opcje zaznaczone na czerwono. Ostatni czynnoci jest sprawdzenie i ewentualne poprawienie
strony ca.html i skryptu ca.pl. W pliku ca.html nalezy wpisa poprawn nazw serwera na ktrym znajduje si
skrypt ca.pl czyli linijk <FORM ACTION="http://localhost/cgi-bin/ca.pl" METHOD=POST>. W ca.pl
naley skontrolowa poprawno podanych cieek oraz wpisa haso jakim zabezpieczony jest klucz prywatny CA
(zmienna $certpass zaznaczona na czerwono).
 

#!/usr/bin/perl
#ca.pl

$config   = "/tmp/ssl/openssl.cnf";
$capath   = "/usr/local/ssl/bin/openssl ca";
$certpass = "tu_jest_haslo";
$tempca   = "/tmp/ssl/cli".rand 10000;
$tempout  = "/tmp/ssl/certtmp".rand 10000;
$caout    = "/tmp/ssl/certwynik.txt";
$CAcert   = "/tmp/ssl/demoCA/cacert.pem";
...
 

Po umieszczeniu tak przygotowanych stron i skryptw na serwerze bdzie mona generowa certyfikaty dla klientw.

Wady i zalety obydwu sposobw generowania i instalowania certyfikatw.

Jak wynika z powyszego opisu bezpieczniejszym i polecanym przeze mnie jest sposb pierwszy. Jego powan wad
jest  fakt e czowiek generujcy certyfikaty znajduje si w posiadaniu klucza prywatnego osoby wystpujcej o
certyfikat.  Oczywicie uczciwy CA powinien skasowa go, zaraz po utworzeniu. W takim wypadku metoda pierwsza
spenia  wszelkie wymogi. Sposb drugi prcz samych wad ma jedn acz ogromn zalet. Mianowicie klucz prywatny
klienta  nigdy nie opuszcza jego komputera. Do wad mona zaliczy fakt e haso zabezpieczajce klucz prywatny CA
znajduje si na serwerze i to w dodatku w aden sposb nie chronione.  Kolejn wad jest generowanie kompletnych
certyfikatw przez strone www, co moe grozi wykradzeniem klucza prywatnego. Rozwizaniem moe by skadowanie
requestw w bazie danych a nastpnie rczna ich obrbka przez administratora. Reasumujc, sposb drugi naley
potraktowa jako demonstracje metody ktr mona przewiczy przed napisaniem porzdnych skryptw.
 

Tajemniczy przecznik -v 3 w stunnelu

Stunnel posiada trzy tryby weryfikacji klienta.
Pierwszy opcja -v 1 oznacza e naley sprbowa zweryfikowa osob nawizujc poczenie czyli uzyska jej
ceryfikat. Jeli operacja ta si nie powiedzie, mimo wszystko dostp do serwera bdzie zapewniony.
Przecznik -v 2 nakazuje stunnelowi zweryfikowa klienta. Jeli uytkownik nie posiada certyfikatu lub certyfikat
jest niewany, niewaciwy czy te nie posiadamy certyfikatu CA ktrym podpisany jest certyfikat klienta
(straszny jest ten jzyk polski) nawizanie poczenia z serwerem bdzie niemoliwe. I wreszcie opcja -v 3 nakazujca
stunnelowi zweryfikowa klienta a take poszuka jego certyfikatu w naszej lokalnej bazie.
Dzieki opcji -v 3 moemy stworzy bardzo selektywny dostp do usug oferowanych przez serwer, unikajc generowania duych iloci certyfikatw. Uwaga oglna: do poprawnej weryfikacji klienta KONIECZNE jest posiadanie certyfikatu CA ktrym podpisany  jest sprawdzany certyfikat. Bez tego stunnel nie jest wstanie przeprowadzi poprawnej autoryzacji klienta. Prba taka koczy si bdami "VERIFY ERROR: self signed certificate for ....." oraz "SSL_accept: error:140890B1:SSL routines: SSL3_GET_CLIENT_CERTIFICATE:no certificate returned". A teraz przykad praktyczny: chcemy aby do https bdcym na porcie 444 miay dostp wszystkie osoby majce certyfikaty natomiast
do do https na porcie 445 dostp mia tylko Jan Kowalski. Pierwsz czynnoci jak naley wykona jest skopiowanie
certyfikatu CA do katalogu /usr/local/ssl/certs (default cert area), nastpnie w tym katalogu naley utworzy
podkatalog o  nazwie mytrusted, poczym skopiowa do niego certyfikat klienta czyli jan.pem. Uwaga: z pliku jan.pem
MUSISZ usun klucz prywatny !!! Czyli  to co si znajduje midzy

-----BEGIN RSA PRIVATE KEY-----
.......
-----END RSA PRIVATE KEY-----

cznie z powyszymi liniami. Nastpnie w katalogach /usr/local/ssl/certs i /usr/local/ssl/certs/mytrusted naley
wykona polecenie
/usr/local/ssl/bin/c_rehash ./
Teraz kolej na uruchomienie stunnela:
stunnel -d 444 -r 80 -v 2
oraz
stunnel -d 445 -r 80 -v 3
Netscapem naley poczy sie z https://localhost:444/ a po pytaniu o certyfikat przedstawi certyfikat nalecy
do pigwy. Dostp do serwera bdzie zapewniony. Czynnoc t naley powtrzy przedstawiajc si za drugim razem
certyfikatem Jana Kowalskiego. Poczenie take bdzie zrealizowane.  W przypadku https://localhost:445/ wejcie
na serwer bdzie zapewnione tylko po wylegitymowaniu si certyfikatem Jana Kowalskiego. Po kazdej zmianie w
katalogu /usr/local/ssl/certs/mytrusted naley wykona komend c_rehash ./ i zrestartowa stunnela.
  stunnel-5.74/doc/stunnel.8.in0000644000175000001440000015562514701524325011572 .\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "stunnel 8" .TH stunnel 8 2024.10.09 5.74 "stunnel TLS Proxy" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME stunnel \- TLS offloading and load\-balancing proxy .SH SYNOPSIS .IX Header "SYNOPSIS" .IP \fBUnix:\fR 4 .IX Item "Unix:" \&\fBstunnel\fR [FILE] | \-fd\ N | \-help | \-version | \-sockets | \-options .IP \fBWIN32:\fR 4 .IX Item "WIN32:" \&\fBstunnel\fR [ [ \-install | \-uninstall | \-start | \-stop | \-reload | \-reopen | \-exit ] [\-quiet] [FILE] ] | \-help | \-version | \-sockets | \-options .SH DESCRIPTION .IX Header "DESCRIPTION" The \fBstunnel\fR program is designed to work as \fITLS\fR encryption wrapper between remote clients and local (\fIinetd\fR\-startable) or remote servers. The concept is that having non-TLS aware daemons running on your system you can easily set them up to communicate with clients over secure \fITLS\fR channels. .PP \&\fBstunnel\fR can be used to add \fITLS\fR functionality to commonly used \fIInetd\fR daemons like POP\-2, POP\-3, and IMAP servers, to standalone daemons like NNTP, SMTP and HTTP, and in tunneling PPP over network sockets without changes to the source code. .PP This product includes cryptographic software written by Eric Young (eay@cryptsoft.com) .SH OPTIONS .IX Header "OPTIONS" .IP \fBFILE\fR 4 .IX Item "FILE" Use specified configuration file .IP "\fB\-fd N\fR (Unix only)" 4 .IX Item "-fd N (Unix only)" Read the config file from specified file descriptor .IP \fB\-help\fR 4 .IX Item "-help" Print \fBstunnel\fR help menu .IP \fB\-version\fR 4 .IX Item "-version" Print \fBstunnel\fR version and compile time defaults .IP \fB\-sockets\fR 4 .IX Item "-sockets" Print default socket options .IP \fB\-options\fR 4 .IX Item "-options" Print supported TLS options .IP "\fB\-install\fR (Windows NT and later only)" 4 .IX Item "-install (Windows NT and later only)" Install NT Service .IP "\fB\-uninstall\fR (Windows NT and later only)" 4 .IX Item "-uninstall (Windows NT and later only)" Uninstall NT Service .IP "\fB\-start\fR (Windows NT and later only)" 4 .IX Item "-start (Windows NT and later only)" Start NT Service .IP "\fB\-stop\fR (Windows NT and later only)" 4 .IX Item "-stop (Windows NT and later only)" Stop NT Service .IP "\fB\-reload\fR (Windows NT and later only)" 4 .IX Item "-reload (Windows NT and later only)" Reload the configuration file of the running NT Service .IP "\fB\-reopen\fR (Windows NT and later only)" 4 .IX Item "-reopen (Windows NT and later only)" Reopen the log file of the running NT Service .IP "\fB\-exit\fR (Win32 only)" 4 .IX Item "-exit (Win32 only)" Exit an already started stunnel .IP "\fB\-quiet\fR (Win32 only)" 4 .IX Item "-quiet (Win32 only)" Don't display any message boxes .SH "CONFIGURATION FILE" .IX Header "CONFIGURATION FILE" Each line of the configuration file can be either: .IP \(bu 4 An empty line (ignored). .IP \(bu 4 A comment starting with ';' (ignored). .IP \(bu 4 An 'option_name = option_value' pair. .IP \(bu 4 \&'[service_name]' indicating a start of a service definition. .PP An address parameter of an option may be either: .IP \(bu 4 A port number. .IP \(bu 4 A colon-separated pair of IP address (either IPv4, IPv6, or domain name) and port number. .IP \(bu 4 A Unix socket path (Unix only). .SS "GLOBAL OPTIONS" .IX Subsection "GLOBAL OPTIONS" .IP "\fBchroot\fR = DIRECTORY (Unix only)" 4 .IX Item "chroot = DIRECTORY (Unix only)" directory to chroot \fBstunnel\fR process .Sp \&\fBchroot\fR keeps \fBstunnel\fR in a chrooted jail. \fICApath\fR, \fICRLpath\fR, \fIpid\fR and \fIexec\fR are located inside the jail and the patches have to be relative to the directory specified with \fBchroot\fR. .Sp Several functions of the operating system also need their files to be located within the chroot jail, e.g.: .RS 4 .IP \(bu 4 Delayed resolver typically needs /etc/nsswitch.conf and /etc/resolv.conf. .IP \(bu 4 Local time in log files needs /etc/timezone. .IP \(bu 4 Some other functions may need devices, e.g. /dev/zero or /dev/null. .RE .RS 4 .RE .IP "\fBcompression\fR = deflate | zlib" 4 .IX Item "compression = deflate | zlib" select data compression algorithm .Sp default: no compression .Sp Deflate is the standard compression method as described in RFC 1951. .IP "\fBdebug\fR = [FACILITY.]LEVEL" 4 .IX Item "debug = [FACILITY.]LEVEL" debugging level .Sp Level is one of the syslog level names or numbers emerg (0), alert (1), crit (2), err (3), warning (4), notice (5), info (6), or debug (7). All logs for the specified level and all levels numerically less than it will be shown. .Sp The \fIdebug = debug\fR (or the equivalent ) level produces for the most verbose log output. This logging level is only meant to be understood by stunnel developers, and not by users. Please either use the debug level when requested to do so by an stunnel developer, or when you intend to get confused. .Sp The default logging level is notice (5). .Sp The syslog 'daemon' facility will be used unless a facility name is supplied. (Facilities are not supported on Win32.) .Sp Case is ignored for both facilities and levels. .IP "\fBEGD\fR = EGD_PATH (Unix only)" 4 .IX Item "EGD = EGD_PATH (Unix only)" path to Entropy Gathering Daemon socket .Sp Entropy Gathering Daemon socket to use to feed the \fBOpenSSL\fR random number generator. .IP "\fBengine\fR = auto | ENGINE_ID" 4 .IX Item "engine = auto | ENGINE_ID" select hardware or software cryptographic engine .Sp default: software-only cryptography .Sp See Examples section for an engine configuration to use the certificate and the corresponding private key from a cryptographic device. .IP "\fBengineCtrl\fR = COMMAND[:PARAMETER]" 4 .IX Item "engineCtrl = COMMAND[:PARAMETER]" control hardware engine .IP "\fBengineDefault\fR = TASK_LIST" 4 .IX Item "engineDefault = TASK_LIST" set OpenSSL tasks delegated to the current engine .Sp The parameter specifies a comma-separated list of task to be delegated to the current engine. .Sp The following tasks may be available, if supported by the engine: ALL, RSA, DSA, ECDH, ECDSA, DH, RAND, CIPHERS, DIGESTS, PKEY, PKEY_CRYPTO, PKEY_ASN1. .IP "\fBfips\fR = yes | no" 4 .IX Item "fips = yes | no" enable or disable FIPS 140\-2 mode. .Sp This option allows you to disable entering FIPS mode if \fBstunnel\fR was compiled with FIPS 140\-2 support. .Sp default: no (since version 5.00) .IP "\fBforeground\fR = yes | quiet | no (Unix only)" 4 .IX Item "foreground = yes | quiet | no (Unix only)" foreground mode .Sp Stay in foreground (don't fork). .Sp With the \fIyes\fR parameter it also logs to stderr in addition to the destinations specified with \fIsyslog\fR and \fIoutput\fR. .Sp default: background in daemon mode .IP "\fBiconActive\fR = ICON_FILE (GUI only)" 4 .IX Item "iconActive = ICON_FILE (GUI only)" GUI icon to be displayed when there are established connections .Sp On Windows platform the parameter should be an .ico file containing a 16x16 pixel image. .IP "\fBiconError\fR = ICON_FILE (GUI only)" 4 .IX Item "iconError = ICON_FILE (GUI only)" GUI icon to be displayed when no valid configuration is loaded .Sp On Windows platform the parameter should be an .ico file containing a 16x16 pixel image. .IP "\fBiconIdle\fR = ICON_FILE (GUI only)" 4 .IX Item "iconIdle = ICON_FILE (GUI only)" GUI icon to be displayed when there are no established connections .Sp On Windows platform the parameter should be an .ico file containing a 16x16 pixel image. .IP "\fBlog\fR = append | overwrite" 4 .IX Item "log = append | overwrite" log file handling .Sp This option allows you to choose whether the log file (specified with the \&\fIoutput\fR option) is appended or overwritten when opened or re-opened. .Sp default: append .IP "\fBoutput\fR = FILE" 4 .IX Item "output = FILE" append log messages to a file .Sp /dev/stdout device can be used to send log messages to the standard output (for example to log them with daemontools splogger). .IP "\fBpid\fR = FILE (Unix only)" 4 .IX Item "pid = FILE (Unix only)" pid file location .Sp If the argument is empty, then no pid file will be created. .Sp \&\fIpid\fR path is relative to the \fIchroot\fR directory if specified. .IP "\fBRNDbytes\fR = BYTES" 4 .IX Item "RNDbytes = BYTES" bytes to read from random seed files .IP "\fBRNDfile\fR = FILE" 4 .IX Item "RNDfile = FILE" path to file with random seed data .Sp The OpenSSL library will use data from this file first to seed the random number generator. .IP "\fBRNDoverwrite\fR = yes | no" 4 .IX Item "RNDoverwrite = yes | no" overwrite the random seed files with new random data .Sp default: yes .IP "\fBservice\fR = SERVICE (Unix only)" 4 .IX Item "service = SERVICE (Unix only)" stunnel service name .Sp The specified service name is used for syslog and as the \fIinetd\fR mode service name for TCP Wrappers. While this option can technically be specified in the service sections, it is only useful in global options. .Sp default: stunnel .IP "\fBsyslog\fR = yes | no (Unix only)" 4 .IX Item "syslog = yes | no (Unix only)" enable logging via syslog .Sp default: yes .IP "\fBtaskbar\fR = yes | no (WIN32 only)" 4 .IX Item "taskbar = yes | no (WIN32 only)" enable the taskbar icon .Sp default: yes .SS "SERVICE-LEVEL OPTIONS" .IX Subsection "SERVICE-LEVEL OPTIONS" Each configuration section begins with a service name in square brackets. The service name is used for libwrap (TCP Wrappers) access control and lets you distinguish \fBstunnel\fR services in your log files. .PP Note that if you wish to run \fBstunnel\fR in \fIinetd\fR mode (where it is provided a network socket by a server such as \fIinetd\fR, \fIxinetd\fR, or \fItcpserver\fR) then you should read the section entitled \fIINETD MODE\fR below. .IP "\fBaccept\fR = [HOST:]PORT" 4 .IX Item "accept = [HOST:]PORT" accept connections on specified address .Sp If no host specified, defaults to all IPv4 addresses for the local host. .Sp To listen on all IPv6 addresses use: .Sp .Vb 1 \& accept = :::PORT .Ve .IP "\fBCAengine\fR = ENGINE\-SPECIFIC_CA_CERTIFICATE_IDENTIFIER" 4 .IX Item "CAengine = ENGINE-SPECIFIC_CA_CERTIFICATE_IDENTIFIER" load a trusted CA certificate from an engine .Sp The loaded CA certificates will be used with the \fIverifyChain\fR and \&\fIverifyPeer\fR options. .Sp Multiple \fICAengine\fR options are allowed in a single service section. .Sp Currently supported engines: pkcs11, cng. .IP "\fBCApath\fR = CA_DIRECTORY" 4 .IX Item "CApath = CA_DIRECTORY" load trusted CA certificates from a directory .Sp The loaded CA certificates will be used with the \fIverifyChain\fR and \&\fIverifyPeer\fR options. Note that the certificates in this directory should be named XXXXXXXX.0 where XXXXXXXX is the hash value of the DER encoded subject of the cert. .Sp This parameter can also be used to provide the root CA certificate needed to validate OCSP stapling in server mode. .Sp The hash algorithm has been changed in \fBOpenSSL 1.0.0\fR. It is required to c_rehash the directory on upgrade from \fBOpenSSL 0.x.x\fR to \fBOpenSSL 1.x.x\fR or later. .Sp \&\fICApath\fR path is relative to the \fIchroot\fR directory if specified. .IP "\fBCAfile\fR = CA_FILE" 4 .IX Item "CAfile = CA_FILE" load trusted CA certificates from a file .Sp The loaded CA certificates will be used with the \fIverifyChain\fR and \&\fIverifyPeer\fR options. .Sp This parameter can also be used to provide the root CA certificate needed to validate OCSP stapling in server mode. .IP "\fBcert\fR = CERT_FILE" 4 .IX Item "cert = CERT_FILE" certificate chain file name .Sp The parameter specifies the file containing certificates used by \fBstunnel\fR to authenticate itself against the remote client or server. The file should contain the whole certificate chain starting from the actual server/client certificate, and ending with the self-signed root CA certificate. The file must be either in PEM or P12 format. .Sp A certificate chain is required in server mode, and optional in client mode. .Sp This parameter is also used as the certificate identifier when a hardware engine is enabled. .IP "\fBcheckEmail\fR = EMAIL" 4 .IX Item "checkEmail = EMAIL" verify the email address of the end-entity (leaf) peer certificate subject .Sp Certificates are accepted if no subject checks were specified, or the email address of the end-entity (leaf) peer certificate matches any of the email addresses specified with \fIcheckEmail\fR. .Sp Multiple \fIcheckEmail\fR options are allowed in a single service section. .Sp This option requires OpenSSL 1.0.2 or later. .IP "\fBcheckHost\fR = HOST" 4 .IX Item "checkHost = HOST" verify the host of the end-entity (leaf) peer certificate subject .Sp Certificates are accepted if no subject checks were specified, or the host name of the end-entity (leaf) peer certificate matches any of the hosts specified with \fIcheckHost\fR. .Sp Multiple \fIcheckHost\fR options are allowed in a single service section. .Sp This option requires OpenSSL 1.0.2 or later. .IP "\fBcheckIP\fR = IP" 4 .IX Item "checkIP = IP" verify the IP address of the end-entity (leaf) peer certificate subject .Sp Certificates are accepted if no subject checks were specified, or the IP address of the end-entity (leaf) peer certificate matches any of the IP addresses specified with \fIcheckIP\fR. .Sp Multiple \fIcheckIP\fR options are allowed in a single service section. .Sp This option requires OpenSSL 1.0.2 or later. .IP "\fBciphers\fR = CIPHER_LIST" 4 .IX Item "ciphers = CIPHER_LIST" select permitted TLS ciphers (TLSv1.2 and below) .Sp This option does not impact TLSv1.3 ciphersuites. .Sp A colon-delimited list of the ciphers to allow in the TLS connection, for example DES\-CBC3\-SHA:IDEA\-CBC\-MD5. .IP "\fBciphersuites\fR = CIPHERSUITES_LIST" 4 .IX Item "ciphersuites = CIPHERSUITES_LIST" select permitted TLSv1.3 ciphersuites .Sp A colon-delimited list of TLSv1.3 ciphersuites names in order of preference. .Sp The \fIciphersuites\fR option ignores unknown ciphers when compiled with \fBOpenSSL 3.0\fR or later. .Sp This option requires OpenSSL 1.1.1 or later. .Sp default: TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256 .IP "\fBclient\fR = yes | no" 4 .IX Item "client = yes | no" client mode (remote service uses TLS) .Sp default: no (server mode) .IP "\fBconfig\fR = COMMAND[:PARAMETER]" 4 .IX Item "config = COMMAND[:PARAMETER]" \&\fBOpenSSL\fR configuration command .Sp The \fBOpenSSL\fR configuration command is executed with the specified parameter. This allows any configuration commands to be invoked from the stunnel configuration file. Supported commands are described on the \&\fR\f(BISSL_CONF_cmd\fR\fI\|(3ssl)\fR manual page. .Sp Several \fIconfig\fR lines can be used to specify multiple configuration commands. .Sp Use \fIcurves\fR option instead of enabling \fIconfig = Curves:list_curves\fR to support elliptic curves. .Sp This option requires OpenSSL 1.0.2 or later. .IP "\fBconnect\fR = [HOST:]PORT" 4 .IX Item "connect = [HOST:]PORT" connect to a remote address .Sp If no host is specified, the host defaults to localhost. .Sp Multiple \fIconnect\fR options are allowed in a single service section. If host resolves to multiple addresses and/or if multiple \fIconnect\fR options are specified, then the remote address is chosen using a round-robin algorithm. .IP "\fBCRLpath\fR = DIRECTORY" 4 .IX Item "CRLpath = DIRECTORY" Certificate Revocation Lists directory .Sp This is the directory in which \fBstunnel\fR will look for CRLs when using the \&\fIverifyChain\fR and \fIverifyPeer\fR options. Note that the CRLs in this directory should be named XXXXXXXX.r0 where XXXXXXXX is the hash value of the CRL. .Sp The hash algorithm has been changed in \fBOpenSSL 1.0.0\fR. It is required to c_rehash the directory on upgrade from \fBOpenSSL 0.x.x\fR to \fBOpenSSL 1.x.x\fR. .Sp \&\fICRLpath\fR path is relative to the \fIchroot\fR directory if specified. .IP "\fBCRLfile\fR = CRL_FILE" 4 .IX Item "CRLfile = CRL_FILE" Certificate Revocation Lists file .Sp This file contains multiple CRLs, used with the \fIverifyChain\fR and \&\fIverifyPeer\fR options. .IP "\fBcurves\fR = list" 4 .IX Item "curves = list" ECDH curves separated with ':' .Sp Only a single curve name is allowed for OpenSSL older than 1.1.1. .Sp To get a list of supported curves use: .Sp .Vb 1 \& openssl ecparam \-list_curves .Ve .Sp default: .Sp .Vb 1 \& X25519:P\-256:X448:P\-521:P\-384 (OpenSSL 1.1.1 or later) \& \& prime256v1 (OpenSSL older than 1.1.1) .Ve .IP "\fBlogId\fR = TYPE" 4 .IX Item "logId = TYPE" connection identifier type .Sp This identifier allows you to distinguish log entries generated for each of the connections. .Sp Currently supported types: .RS 4 .IP \fIsequential\fR 4 .IX Item "sequential" The numeric sequential identifier is only unique within a single instance of \&\fBstunnel\fR, but very compact. It is most useful for manual log analysis. .IP \fIunique\fR 4 .IX Item "unique" This alphanumeric identifier is globally unique, but longer than the sequential number. It is most useful for automated log analysis. .IP \fIthread\fR 4 .IX Item "thread" The operating system thread identifier is neither unique (even within a single instance of \fBstunnel\fR) nor short. It is most useful for debugging software or configuration issues. .IP \fIprocess\fR 4 .IX Item "process" The operating system process identifier (PID) may be useful in the inetd mode. .RE .RS 4 .Sp default: sequential .RE .IP "\fBdebug\fR = LEVEL" 4 .IX Item "debug = LEVEL" debugging level .Sp Level is a one of the syslog level names or numbers emerg (0), alert (1), crit (2), err (3), warning (4), notice (5), info (6), or debug (7). All logs for the specified level and all levels numerically less than it will be shown. The default is notice (5). .Sp While the \fIdebug = debug\fR or \fIdebug = 7\fR level generates the most verbose output, it is only intended to be used by stunnel developers. Please only use this value if you are a developer, or you intend to send your logs to our technical support. Otherwise, the generated logs \fBwill\fR be confusing. .IP "\fBdelay\fR = yes | no" 4 .IX Item "delay = yes | no" delay DNS lookup for the \fIconnect\fR option .Sp This option is useful for dynamic DNS, or when DNS is not available during \&\fBstunnel\fR startup (road warrior VPN, dial-up configurations). .Sp Delayed resolver mode is automatically engaged when stunnel fails to resolve on startup any of the \fIconnect\fR targets for a service. .Sp Delayed resolver inflicts \fIfailover = prio\fR. .Sp default: no .IP "\fBengineId\fR = ENGINE_ID" 4 .IX Item "engineId = ENGINE_ID" select engine ID for the service .IP "\fBengineNum\fR = ENGINE_NUMBER" 4 .IX Item "engineNum = ENGINE_NUMBER" select engine number for the service .Sp The engines are numbered starting from 1. .IP "\fBexec\fR = EXECUTABLE_PATH" 4 .IX Item "exec = EXECUTABLE_PATH" execute a local inetd-type program .Sp \&\fIexec\fR path is relative to the \fIchroot\fR directory if specified. .Sp The following environmental variables are set on Unix platforms: REMOTE_HOST, REMOTE_PORT, SSL_CLIENT_DN, SSL_CLIENT_I_DN. .ie n .IP "\fBexecArgs\fR = $0 $1 $2 ..." 4 .el .IP "\fBexecArgs\fR = \f(CW$0\fR \f(CW$1\fR \f(CW$2\fR ..." 4 .IX Item "execArgs = $0 $1 $2 ..." arguments for \fIexec\fR including the program name ($0) .Sp Quoting is currently not supported. Arguments are separated with an arbitrary amount of whitespace. .IP "\fBfailover\fR = rr | prio" 4 .IX Item "failover = rr | prio" Failover strategy for multiple "connect" targets. .RS 4 .IP \fIrr\fR 4 .IX Item "rr" round robin \- fair load distribution .IP \fIprio\fR 4 .IX Item "prio" priority \- use the order specified in config file .RE .RS 4 .Sp default: prio .RE .IP "\fBident\fR = USERNAME" 4 .IX Item "ident = USERNAME" use IDENT (RFC 1413) username checking .IP "\fBinclude\fR = DIRECTORY" 4 .IX Item "include = DIRECTORY" include all configuration file parts located in DIRECTORY .Sp The files are included in the ascending alphabetical order of their names. The recommended filename convention is .Sp for global options: .Sp .Vb 1 \& 00\-global.conf .Ve .Sp for local service-level options: .Sp .Vb 1 \& 01\-service.conf \& \& 02\-service.conf .Ve .IP "\fBkey\fR = KEY_FILE" 4 .IX Item "key = KEY_FILE" private key for the certificate specified with \fIcert\fR option .Sp A private key is needed to authenticate the certificate owner. Since this file should be kept secret it should only be readable by its owner. On Unix systems you can use the following command: .Sp .Vb 1 \& chmod 600 keyfile .Ve .Sp This parameter is also used as the private key identifier when a hardware engine is enabled. .Sp default: the value of the \fIcert\fR option .IP "\fBlibwrap\fR = yes | no" 4 .IX Item "libwrap = yes | no" Enable or disable the use of /etc/hosts.allow and /etc/hosts.deny. .Sp default: no (since version 5.00) .IP "\fBlocal\fR = HOST" 4 .IX Item "local = HOST" By default, the IP address of the outgoing interface is used as the source for remote connections. Use this option to bind a static local IP address instead. .IP "\fBOCSP\fR = URL" 4 .IX Item "OCSP = URL" select OCSP responder for the end-entity (leaf) peer certificate verification .IP "\fBOCSPaia\fR = yes | no" 4 .IX Item "OCSPaia = yes | no" validate certificates with their AIA OCSP responders .Sp This option enables \fIstunnel\fR to validate certificates with the list of OCSP responder URLs retrieved from their AIA (Authority Information Access) extension. .IP "\fBOCSPflag\fR = OCSP_FLAG" 4 .IX Item "OCSPflag = OCSP_FLAG" specify OCSP responder flag .Sp Several \fIOCSPflag\fR can be used to specify multiple flags. .Sp currently supported flags: NOCERTS, NOINTERN, NOSIGS, NOCHAIN, NOVERIFY, NOEXPLICIT, NOCASIGN, NODELEGATED, NOCHECKS, TRUSTOTHER, RESPID_KEY, NOTIME .IP "\fBOCSPnonce\fR = yes | no" 4 .IX Item "OCSPnonce = yes | no" send and verify the OCSP nonce extension .Sp This option protects the OCSP protocol against replay attacks. Due to its computational overhead, the nonce extension is usually only supported on internal (e.g. corporate) responders, and not on public OCSP responders. .IP "\fBOCSPrequire\fR = yes | no" 4 .IX Item "OCSPrequire = yes | no" require a conclusive OCSP response .Sp Disable this option to allow a connection even though no conclusive OCSP response was retrieved from stapling and a direct request to the OCSP responder. .Sp default: yes .IP "\fBoptions\fR = SSL_OPTIONS" 4 .IX Item "options = SSL_OPTIONS" \&\fBOpenSSL\fR library options .Sp The parameter is the \fBOpenSSL\fR option name as described in the \&\fR\f(BISSL_CTX_set_options\fR\fI\|(3ssl)\fR manual, but without \fISSL_OP_\fR prefix. \&\fIstunnel \-options\fR lists the options found to be allowed in the current combination of \fIstunnel\fR and the \fIOpenSSL\fR library used to build it. .Sp Several \fIoption\fR lines can be used to specify multiple options. An option name can be prepended with a dash ("\-") to disable the option. .Sp For example, for compatibility with the erroneous Eudora TLS implementation, the following option can be used: .Sp .Vb 1 \& options = DONT_INSERT_EMPTY_FRAGMENTS .Ve .Sp default: .Sp .Vb 2 \& options = NO_SSLv2 \& options = NO_SSLv3 .Ve .Sp Use \fIsslVersionMax\fR or \fIsslVersionMin\fR option instead of disabling specific TLS protocol versions when compiled with \fBOpenSSL 1.1.0\fR or later. .IP "\fBprotocol\fR = PROTO" 4 .IX Item "protocol = PROTO" application protocol to negotiate TLS .Sp This option enables initial, protocol-specific negotiation of the TLS encryption. The \fIprotocol\fR option should not be used with TLS encryption on a separate port. .Sp Currently supported protocols: .RS 4 .IP \fIcifs\fR 4 .IX Item "cifs" Proprietary (undocummented) extension of CIFS protocol implemented in Samba. Support for this extension was dropped in Samba 3.0.0. .IP \fIcapwin\fR 4 .IX Item "capwin" http://www.capwin.org/ application support .IP \fIcapwinctrl\fR 4 .IX Item "capwinctrl" http://www.capwin.org/ application support .Sp This protocol is only supported in client mode. .IP \fIconnect\fR 4 .IX Item "connect" Based on RFC 2817 \- \fIUpgrading to TLS Within HTTP/1.1\fR, section 5.2 \- \fIRequesting a Tunnel with CONNECT\fR .Sp This protocol is only supported in client mode. .IP \fIimap\fR 4 .IX Item "imap" Based on RFC 2595 \- \fIUsing TLS with IMAP, POP3 and ACAP\fR .IP \fIldap\fR 4 .IX Item "ldap" Based on RFC 2830 \- \fILightweight Directory Access Protocol (v3): Extension for Transport Layer Security\fR .IP \fInntp\fR 4 .IX Item "nntp" Based on RFC 4642 \- \fIUsing Transport Layer Security (TLS) with Network News Transfer Protocol (NNTP)\fR .Sp This protocol is only supported in client mode. .IP \fIpgsql\fR 4 .IX Item "pgsql" Based on \&\fIhttp://www.postgresql.org/docs/8.3/static/protocol\-flow.html#AEN73982\fR .IP \fIpop3\fR 4 .IX Item "pop3" Based on RFC 2449 \- \fIPOP3 Extension Mechanism\fR .IP \fIproxy\fR 4 .IX Item "proxy" Passing of the original client IP address with HAProxy PROXY protocol version 1 \&\fIhttps://www.haproxy.org/download/1.8/doc/proxy\-protocol.txt\fR .IP \fIsmtp\fR 4 .IX Item "smtp" Based on RFC 2487 \- \fISMTP Service Extension for Secure SMTP over TLS\fR .IP \fIsocks\fR 4 .IX Item "socks" SOCKS versions 4, 4a, and 5 are supported. The SOCKS protocol itself is encapsulated within TLS encryption layer to protect the final destination address. .Sp \&\fIhttp://www.openssh.com/txt/socks4.protocol\fR .Sp \&\fIhttp://www.openssh.com/txt/socks4a.protocol\fR .Sp The BIND command of the SOCKS protocol is not supported. The USERID parameter is ignored. .Sp See Examples section for sample configuration files for VPN based on SOCKS encryption. .RE .RS 4 .RE .IP "\fBprotocolAuthentication\fR = AUTHENTICATION" 4 .IX Item "protocolAuthentication = AUTHENTICATION" authentication type for the protocol negotiations .Sp Currently, this option is only supported in the client-side 'connect' and \&'smtp' protocols. .Sp Supported authentication types for the 'connect' protocol are 'basic' or \&'ntlm'. The default 'connect' authentication type is 'basic'. .Sp Supported authentication types for the 'smtp' protocol are 'plain' or 'login'. The default 'smtp' authentication type is 'plain'. .IP "\fBprotocolDomain\fR = DOMAIN" 4 .IX Item "protocolDomain = DOMAIN" domain for the protocol negotiations .Sp Currently, this option is only supported in the client-side 'connect' protocol. .IP "\fBprotocolHeader\fR = HEADER" 4 .IX Item "protocolHeader = HEADER" header for the protocol negotiations .Sp Currently, this option is only supported in the client-side 'connect' protocol. .IP "\fBprotocolHost\fR = ADDRESS" 4 .IX Item "protocolHost = ADDRESS" host address for the protocol negotiations .Sp For the 'connect' protocol negotiations, \fIprotocolHost\fR specifies HOST:PORT of the final TLS server to be connected to by the proxy. The proxy server directly connected by \fBstunnel\fR must be specified with the \fIconnect\fR option. .Sp For the 'smtp' protocol negotiations, \fIprotocolHost\fR controls the client SMTP HELO/EHLO value. .IP "\fBprotocolPassword\fR = PASSWORD" 4 .IX Item "protocolPassword = PASSWORD" password for the protocol negotiations .Sp Currently, this option is only supported in the client-side 'connect' and \&'smtp' protocols. .IP "\fBprotocolUsername\fR = USERNAME" 4 .IX Item "protocolUsername = USERNAME" username for the protocol negotiations .Sp Currently, this option is only supported in the client-side 'connect' and \&'smtp' protocols. .IP "\fBPSKidentity\fR = IDENTITY" 4 .IX Item "PSKidentity = IDENTITY" PSK identity for the PSK client .Sp \&\fIPSKidentity\fR can be used on \fBstunnel\fR clients to select the PSK identity used for authentication. This option is ignored in server sections. .Sp default: the first identity specified in the \fIPSKsecrets\fR file. .IP "\fBPSKsecrets\fR = FILE" 4 .IX Item "PSKsecrets = FILE" file with PSK identities and corresponding keys .Sp Each line of the file in the following format: .Sp .Vb 1 \& IDENTITY:KEY .Ve .Sp Hexadecimal keys are automatically converted to binary form. Keys are required to be at least 16 bytes long, which implies at least 32 characters for hexadecimal keys. The file should neither be world-readable nor world-writable. .IP "\fBpty\fR = yes | no (Unix only)" 4 .IX Item "pty = yes | no (Unix only)" allocate a pseudoterminal for 'exec' option .IP "\fBredirect\fR = [HOST:]PORT" 4 .IX Item "redirect = [HOST:]PORT" redirect TLS client connections on certificate-based authentication failures .Sp This option only works in server mode. Some protocol negotiations are also incompatible with the \fIredirect\fR option. .IP "\fBrenegotiation\fR = yes | no" 4 .IX Item "renegotiation = yes | no" support TLS renegotiation .Sp Applications of the TLS renegotiation include some authentication scenarios, or re-keying long lasting connections. .Sp On the other hand this feature can facilitate a trivial CPU-exhaustion DoS attack: .Sp \&\fIhttp://vincent.bernat.im/en/blog/2011\-ssl\-dos\-mitigation.html\fR .Sp Please note that disabling TLS renegotiation does not fully mitigate this issue. .Sp default: yes (if supported by \fBOpenSSL\fR) .IP "\fBreset\fR = yes | no" 4 .IX Item "reset = yes | no" attempt to use the TCP RST flag to indicate an error .Sp This option is not supported on some platforms. .Sp default: yes .IP "\fBretry\fR = yes | no | DELAY" 4 .IX Item "retry = yes | no | DELAY" reconnect a connect+exec section after it was disconnected .Sp The DELAY value specifies the number of milliseconds before retrying. "retry = yes" has the same effect as "retry = 1000". .Sp default: no .IP "\fBsecurityLevel\fR = LEVEL" 4 .IX Item "securityLevel = LEVEL" set the security level .Sp The meaning of each level is described below: .RS 4 .IP "level 0" 4 .IX Item "level 0" Everything is permitted. .IP "level 1" 4 .IX Item "level 1" The security level corresponds to a minimum of 80 bits of security. Any parameters offering below 80 bits of security are excluded. As a result RSA, DSA and DH keys shorter than 1024 bits and ECC keys shorter than 160 bits are prohibited. All export cipher suites are prohibited since they all offer less than 80 bits of security. SSL version 2 is prohibited. Any cipher suite using MD5 for the MAC is also prohibited. Additionally, SSLv3, TLS 1.0, TLS 1.1 are all disabled for OpenSSL 3.0 and later. .IP "level 2" 4 .IX Item "level 2" Security level set to 112 bits of security. As a result RSA, DSA and DH keys shorter than 2048 bits and ECC keys shorter than 224 bits are prohibited. In addition to the level 1 exclusions any cipher suite using RC4 is also prohibited. Compression is disabled. SSL version 3 is also not allowed for OpenSSL older than 3.0. .IP "level 3" 4 .IX Item "level 3" Security level set to 128 bits of security. As a result RSA, DSA and DH keys shorter than 3072 bits and ECC keys shorter than 256 bits are prohibited. In addition to the level 2 exclusions cipher suites not offering forward secrecy are prohibited. Session tickets are disabled. TLS versions below 1.1 are not permitted for OpenSSL older than 3.0. .IP "level 4" 4 .IX Item "level 4" Security level set to 192 bits of security. As a result RSA, DSA and DH keys shorter than 7680 bits and ECC keys shorter than 384 bits are prohibited. Cipher suites using SHA1 for the MAC are prohibited. TLS versions below 1.2 are not permitted for OpenSSL older than 3.0. .IP "level 5" 4 .IX Item "level 5" Security level set to 256 bits of security. As a result RSA, DSA and DH keys shorter than 15360 bits and ECC keys shorter than 512 bits are prohibited. .IP "default: 2" 4 .IX Item "default: 2" .RE .RS 4 .Sp The \fIsecurityLevel\fR option is only available when compiled with \fBOpenSSL 1.1.0\fR and later. .RE .IP "\fBrequireCert\fR = yes | no" 4 .IX Item "requireCert = yes | no" require a client certificate for \fIverifyChain\fR or \fIverifyPeer\fR .Sp With \fIrequireCert\fR set to \fIno\fR, the \fBstunnel\fR server accepts client connections that did not present a certificate. .Sp Both \fIverifyChain = yes\fR and \fIverifyPeer = yes\fR imply \fIrequireCert = yes\fR. .Sp default: no .IP "\fBsetgid\fR = GROUP (Unix only)" 4 .IX Item "setgid = GROUP (Unix only)" Unix group id .Sp As a global option: \fBsetgid()\fR to the specified group in daemon mode and clear all other groups. .Sp As a service-level option: set the group of the Unix socket specified with "accept". .IP "\fBsetuid\fR = USER (Unix only)" 4 .IX Item "setuid = USER (Unix only)" Unix user id .Sp As a global option: \fBsetuid()\fR to the specified user in daemon mode. .Sp As a service-level option: set the owner of the Unix socket specified with "accept". .IP "\fBsessionCacheSize\fR = NUM_ENTRIES" 4 .IX Item "sessionCacheSize = NUM_ENTRIES" session cache size .Sp \&\fIsessionCacheSize\fR specifies the maximum number of the internal session cache entries. .Sp The value of 0 can be used for unlimited size. It is not recommended for production use due to the risk of a memory exhaustion DoS attack. .IP "\fBsessionCacheTimeout\fR = TIMEOUT" 4 .IX Item "sessionCacheTimeout = TIMEOUT" session cache timeout .Sp This is the number of seconds to keep cached TLS sessions. .IP "\fBsessionResume\fR = yes | no" 4 .IX Item "sessionResume = yes | no" allow or disallow session resumption .Sp default: yes .IP "\fBsessiond\fR = HOST:PORT" 4 .IX Item "sessiond = HOST:PORT" address of sessiond TLS cache server .IP "\fBsni\fR = SERVICE_NAME:SERVER_NAME_PATTERN (server mode)" 4 .IX Item "sni = SERVICE_NAME:SERVER_NAME_PATTERN (server mode)" Use the service as a secondary service (a name-based virtual server) for Server Name Indication TLS extension (RFC 3546). .Sp \&\fISERVICE_NAME\fR specifies the primary service that accepts client connections with the \fIaccept\fR option. \fISERVER_NAME_PATTERN\fR specifies the host name to be redirected. The pattern may start with the '*' character, e.g. \&'*.example.com'. Multiple secondary services are normally specified for a single primary service. The \fIsni\fR option can also be specified more than once within a single secondary service. .Sp This service, as well as the primary service, may not be configured in client mode. .Sp The \fIconnect\fR option of the secondary service is ignored when the \fIprotocol\fR option is specified, as \fIprotocol\fR connects to the remote host before TLS handshake. .Sp Libwrap checks (Unix only) are performed twice: with the primary service name after TCP connection is accepted, and with the secondary service name during the TLS handshake. .Sp The \fIsni\fR option is only available when compiled with \fBOpenSSL 1.0.0\fR and later. .IP "\fBsni\fR = SERVER_NAME (client mode)" 4 .IX Item "sni = SERVER_NAME (client mode)" Use the parameter as the value of TLS Server Name Indication (RFC 3546) extension. .Sp Empty SERVER_NAME disables sending the SNI extension. .Sp The \fIsni\fR option is only available when compiled with \fBOpenSSL 1.0.0\fR and later. .IP "\fBsocket\fR = a|l|r:OPTION=VALUE[:VALUE]" 4 .IX Item "socket = a|l|r:OPTION=VALUE[:VALUE]" Set an option on the accept/local/remote socket .Sp The values for the linger option are l_onof:l_linger. The values for the time are tv_sec:tv_usec. .Sp Examples: .Sp .Vb 9 \& socket = l:SO_LINGER=1:60 \& set one minute timeout for closing local socket \& socket = r:SO_OOBINLINE=yes \& place out\-of\-band data directly into the \& receive data stream for remote sockets \& socket = a:SO_REUSEADDR=no \& disable address reuse (enabled by default) \& socket = a:SO_BINDTODEVICE=lo \& only accept connections on loopback interface .Ve .IP "\fBsslVersion\fR = SSL_VERSION" 4 .IX Item "sslVersion = SSL_VERSION" select the TLS protocol version .Sp Supported versions: all, SSLv2, SSLv3, TLSv1, TLSv1.1, TLSv1.2, TLSv1.3 .Sp Availability of specific protocols depends on the linked OpenSSL library. Older versions of OpenSSL do not support TLSv1.1, TLSv1.2 and TLSv1.3. Newer versions of OpenSSL do not support SSLv2. .Sp Obsolete SSLv2 and SSLv3 are currently disabled by default. .Sp Setting the option .Sp .Vb 1 \& sslVersion = SSL_VERSION .Ve .Sp is equivalent to options .Sp .Vb 2 \& sslVersionMax = SSL_VERSION \& sslVersionMin = SSL_VERSION .Ve .Sp when compiled with \fBOpenSSL 1.1.0\fR and later. .IP "\fBsslVersionMax\fR = SSL_VERSION" 4 .IX Item "sslVersionMax = SSL_VERSION" maximum supported protocol versions .Sp Supported versions: all, SSLv3, TLSv1, TLSv1.1, TLSv1.2, TLSv1.3 .Sp \&\fIall\fR enable protocol versions up to the highest version supported by the linked OpenSSL library. .Sp Availability of specific protocols depends on the linked OpenSSL library. .Sp The \fIsslVersionMax\fR option is only available when compiled with \&\fBOpenSSL 1.1.0\fR and later. .Sp default: all .IP "\fBsslVersionMin\fR = SSL_VERSION" 4 .IX Item "sslVersionMin = SSL_VERSION" minimum supported protocol versions .Sp Supported versions: all, SSLv3, TLSv1, TLSv1.1, TLSv1.2, TLSv1.3 .Sp \&\fIall\fR enable protocol versions down to the lowest version supported by the linked OpenSSL library. .Sp Availability of specific protocols depends on the linked OpenSSL library. .Sp The \fIsslVersionMin\fR option is only available when compiled with \&\fBOpenSSL 1.1.0\fR and later. .Sp default: TLSv1 .IP "\fBstack\fR = BYTES (except for FORK model)" 4 .IX Item "stack = BYTES (except for FORK model)" CPU stack size of created threads .Sp Excessive thread stack size increases virtual memory usage. Insufficient thread stack size may cause application crashes. .Sp default: 65536 bytes (sufficient for all platforms we tested) .IP "\fBticketKeySecret\fR = SECRET" 4 .IX Item "ticketKeySecret = SECRET" hexadecimal symmetric key used for session ticket confidentiality protection .Sp Session tickets defined in RFC 5077 provide an enhanced session resumption capability, where the server-side caching is not required to maintain per session state. .Sp Combining \fIticketKeySecret\fR and \fIticketMacSecret\fR options allow to resume a negotiated session on other cluster nodes, or to resume a negotiated session after server restart. .Sp The key is required to be either 16 or 32 bytes long, which implies exactly 32 or 64 hexadecimal digits. Colons may optionally be used between two-character hexadecimal bytes. .Sp This option only works in server mode. .Sp The \fIticketKeySecret\fR option is only available when compiled with \&\fBOpenSSL 1.0.0\fR and later. .Sp Disabling \fINO_TICKET\fR option is required for the ticket support in OpenSSL older than 1.1.1, but note that this option is incompatible with the \&\fIredirect\fR option. .IP "\fBticketMacSecret\fR = SECRET" 4 .IX Item "ticketMacSecret = SECRET" hexadecimal symmetric key used for session ticket integrity protection .Sp The key is required to be either 16 or 32 bytes long, which implies exactly 32 or 64 hexadecimal digits. Colons may optionally be used between two-character hexadecimal bytes. .Sp This option only works in server mode. .Sp The \fIticketMacSecret\fR option is only available when compiled with \&\fBOpenSSL 1.0.0\fR and later. .IP "\fBTIMEOUTbusy\fR = SECONDS" 4 .IX Item "TIMEOUTbusy = SECONDS" time to wait for expected data .IP "\fBTIMEOUTclose\fR = SECONDS" 4 .IX Item "TIMEOUTclose = SECONDS" time to wait for close_notify (set to 0 for buggy MSIE) .IP "\fBTIMEOUTconnect\fR = SECONDS" 4 .IX Item "TIMEOUTconnect = SECONDS" time to wait to connect a remote host .IP "\fBTIMEOUTidle\fR = SECONDS" 4 .IX Item "TIMEOUTidle = SECONDS" time to keep an idle connection .IP "\fBTIMEOUTocsp\fR = SECONDS" 4 .IX Item "TIMEOUTocsp = SECONDS" time to wait to connect an OCSP responder .IP "\fBtransparent\fR = none | source | destination | both (Unix only)" 4 .IX Item "transparent = none | source | destination | both (Unix only)" enable transparent proxy support on selected platforms .Sp Supported values: .RS 4 .IP \fInone\fR 4 .IX Item "none" Disable transparent proxy support. This is the default. .IP \fIsource\fR 4 .IX Item "source" Re-write the address to appear as if a wrapped daemon is connecting from the TLS client machine instead of the machine running \fBstunnel\fR. .Sp This option is currently available in: .RS 4 .IP "Remote mode (\fIconnect\fR option) on \fILinux >=2.6.28\fR" 4 .IX Item "Remote mode (connect option) on Linux >=2.6.28" This configuration requires \fBstunnel\fR to be executed as root and without the \fIsetuid\fR option. .Sp This configuration requires the following setup for iptables and routing (possibly in /etc/rc.local or equivalent file): .Sp .Vb 7 \& iptables \-t mangle \-N DIVERT \& iptables \-t mangle \-A PREROUTING \-p tcp \-m socket \-j DIVERT \& iptables \-t mangle \-A DIVERT \-j MARK \-\-set\-mark 1 \& iptables \-t mangle \-A DIVERT \-j ACCEPT \& ip rule add fwmark 1 lookup 100 \& ip route add local 0.0.0.0/0 dev lo table 100 \& echo 0 >/proc/sys/net/ipv4/conf/lo/rp_filter .Ve .Sp \&\fBstunnel\fR must also to be executed as root and without the \fIsetuid\fR option. .IP "Remote mode (\fIconnect\fR option) on \fILinux 2.2.x\fR" 4 .IX Item "Remote mode (connect option) on Linux 2.2.x" This configuration requires the kernel to be compiled with the \fItransparent proxy\fR option. Connected service must be installed on a separate host. Routing towards the clients has to go through the \fBstunnel\fR box. .Sp \&\fBstunnel\fR must also to be executed as root and without the \fIsetuid\fR option. .IP "Remote mode (\fIconnect\fR option) on \fIFreeBSD >=8.0\fR" 4 .IX Item "Remote mode (connect option) on FreeBSD >=8.0" This configuration requires additional firewall and routing setup. \&\fBstunnel\fR must also to be executed as root and without the \fIsetuid\fR option. .IP "Local mode (\fIexec\fR option)" 4 .IX Item "Local mode (exec option)" This configuration works by pre-loading the \fIlibstunnel.so\fR shared library. _RLD_LIST environment variable is used on Tru64, and LD_PRELOAD variable on other platforms. .RE .RS 4 .RE .IP \fIdestination\fR 4 .IX Item "destination" The original destination is used instead of the \fIconnect\fR option. .Sp A service section for transparent destination may look like this: .Sp .Vb 4 \& [transparent] \& client = yes \& accept = \& transparent = destination .Ve .Sp This configuration requires iptables setup to work, possibly in /etc/rc.local or equivalent file. .Sp For a connect target installed on the same host: .Sp .Vb 3 \& /sbin/iptables \-t nat \-I OUTPUT \-p tcp \-\-dport \e \& \-m ! \-\-uid\-owner \e \& \-j DNAT \-\-to\-destination : .Ve .Sp For a connect target installed on a remote host: .Sp .Vb 3 \& /sbin/iptables \-I INPUT \-i eth0 \-p tcp \-\-dport \-j ACCEPT \& /sbin/iptables \-t nat \-I PREROUTING \-p tcp \-\-dport \e \& \-i eth0 \-j DNAT \-\-to\-destination : .Ve .Sp The transparent destination option is currently only supported on Linux. .IP \fIboth\fR 4 .IX Item "both" Use both \fIsource\fR and \fIdestination\fR transparent proxy. .RE .RS 4 .Sp Two legacy options are also supported for backward compatibility: .IP \fIyes\fR 4 .IX Item "yes" This option has been renamed to \fIsource\fR. .IP \fIno\fR 4 .IX Item "no" This option has been renamed to \fInone\fR. .RE .RS 4 .RE .IP "\fBverify\fR = LEVEL" 4 .IX Item "verify = LEVEL" verify the peer certificate .Sp This option is obsolete and should be replaced with the \fIverifyChain\fR and \fIverifyPeer\fR options. .RS 4 .IP "level 0" 4 .IX Item "level 0" Request and ignore the peer certificate chain. .IP "level 1" 4 .IX Item "level 1" Verify the peer certificate chain if present. .IP "level 2" 4 .IX Item "level 2" Verify the peer certificate chain. .IP "level 3" 4 .IX Item "level 3" Verify the peer certificate chain and the end-entity (leaf) peer certificate against a locally installed certificate. .IP "level 4" 4 .IX Item "level 4" Ignore the peer certificate chain and only verify the end-entity (leaf) peer certificate against a locally installed certificate. .IP default 4 .IX Item "default" No verify. .RE .RS 4 .RE .IP "\fBverifyChain\fR = yes | no" 4 .IX Item "verifyChain = yes | no" verify the peer certificate chain starting from the root CA .Sp For server certificate verification it is essential to also require a specific certificate with \fIcheckHost\fR or \fIcheckIP\fR. .Sp The self-signed root CA certificate needs to be stored either in the file specified with \fICAfile\fR, or in the directory specified with \fICApath\fR. .Sp default: no .IP "\fBverifyPeer\fR = yes | no" 4 .IX Item "verifyPeer = yes | no" verify the end-entity (leaf) peer certificate .Sp The end-entity (leaf) peer certificate needs to be stored either in the file specified with \fICAfile\fR, or in the directory specified with \fICApath\fR. .Sp default: no .SH "RETURN VALUE" .IX Header "RETURN VALUE" \&\fBstunnel\fR returns zero on success, non-zero on error. .SH SIGNALS .IX Header "SIGNALS" The following signals can be used to control \fBstunnel\fR in Unix environment: .IP SIGHUP 4 .IX Item "SIGHUP" Force a reload of the configuration file. .Sp Some global options will not be reloaded: .RS 4 .IP \(bu 4 chroot .IP \(bu 4 foreground .IP \(bu 4 pid .IP \(bu 4 setgid .IP \(bu 4 setuid .RE .RS 4 .Sp The use of the 'setuid' option will also prevent \fBstunnel\fR from binding to privileged (<1024) ports during configuration reloading. .Sp When the 'chroot' option is used, \fBstunnel\fR will look for all its files (including the configuration file, certificates, the log file and the pid file) within the chroot jail. .RE .IP SIGUSR1 4 .IX Item "SIGUSR1" Close and reopen the \fBstunnel\fR log file. This function can be used for log rotation. .IP SIGUSR2 4 .IX Item "SIGUSR2" Log the list of active connections. .IP "SIGTERM, SIGQUIT, SIGINT" 4 .IX Item "SIGTERM, SIGQUIT, SIGINT" Shut \fBstunnel\fR down. .PP The result of sending any other signals to the server is undefined. .SH EXAMPLES .IX Header "EXAMPLES" In order to provide TLS encapsulation to your local \fIimapd\fR service, use: .PP .Vb 4 \& [imapd] \& accept = 993 \& exec = /usr/sbin/imapd \& execArgs = imapd .Ve .PP or in remote mode: .PP .Vb 3 \& [imapd] \& accept = 993 \& connect = 143 .Ve .PP In order to let your local e\-mail client connect to a TLS-enabled \fIimapd\fR service on another server, configure the e\-mail client to connect to localhost on port 119 and use: .PP .Vb 4 \& [imap] \& client = yes \& accept = 143 \& connect = servername:993 .Ve .PP If you want to provide tunneling to your \fIpppd\fR daemon on port 2020, use something like: .PP .Vb 5 \& [vpn] \& accept = 2020 \& exec = /usr/sbin/pppd \& execArgs = pppd local \& pty = yes .Ve .PP If you want to use \fBstunnel\fR in \fIinetd\fR mode to launch your imapd process, you'd use this \fIstunnel.conf\fR. Note there must be no \fI[service_name]\fR section. .PP .Vb 2 \& exec = /usr/sbin/imapd \& execArgs = imapd .Ve .PP To setup SOCKS VPN configure the following client service: .PP .Vb 6 \& [socks_client] \& client = yes \& accept = 127.0.0.1:1080 \& connect = vpn_server:9080 \& verifyPeer = yes \& CAfile = stunnel.pem .Ve .PP The corresponding configuration on the vpn_server host: .PP .Vb 5 \& [socks_server] \& protocol = socks \& accept = 9080 \& cert = stunnel.pem \& key = stunnel.key .Ve .PP Now test your configuration on the client machine with: .PP .Vb 1 \& curl \-\-socks4a localhost http://www.example.com/ .Ve .PP An example server mode SNI configuration: .PP .Vb 5 \& [virtual] \& ; primary service \& accept = 443 \& cert = default.pem \& connect = default.internal.mydomain.com:8080 \& \& [sni1] \& ; secondary service 1 \& sni = virtual:server1.mydomain.com \& cert = server1.pem \& connect = server1.internal.mydomain.com:8081 \& \& [sni2] \& ; secondary service 2 \& sni = virtual:server2.mydomain.com \& cert = server2.pem \& connect = server2.internal.mydomain.com:8082 \& verifyPeer = yes \& CAfile = server2\-allowed\-clients.pem .Ve .PP An example of advanced engine configuration allows for authentication with private keys stored in the Windows certificate store (Windows only). With the CAPI engine you don't need to manually select the client key to use. The client key is automatically selected based on the list of CAs trusted by the server. .PP .Vb 1 \& engine = capi \& \& [service] \& engineId = capi \& client = yes \& accept = 127.0.0.1:8080 \& connect = example.com:8443 .Ve .PP An example of advanced engine configuration to use the certificate and the corresponding private key from a pkcs11 engine: .PP .Vb 3 \& engine = pkcs11 \& engineCtrl = MODULE_PATH:opensc\-pkcs11.so \& engineCtrl = PIN:123456 \& \& [service] \& engineId = pkcs11 \& client = yes \& accept = 127.0.0.1:8080 \& connect = example.com:843 \& cert = pkcs11:token=MyToken;object=MyCert \& key = pkcs11:token=MyToken;object=MyKey .Ve .PP An example of advanced engine configuration to use the certificate and the corresponding private key from a SoftHSM token: .PP .Vb 3 \& engine = pkcs11 \& engineCtrl = MODULE_PATH:softhsm2.dll \& engineCtrl = PIN:12345 \& \& [service] \& engineId = pkcs11 \& client = yes \& accept = 127.0.0.1:8080 \& connect = example.com:843 \& cert = pkcs11:token=MyToken;object=KeyCert .Ve .SH NOTES .IX Header "NOTES" .SS RESTRICTIONS .IX Subsection "RESTRICTIONS" \&\fBstunnel\fR cannot be used for the FTP daemon because of the nature of the FTP protocol which utilizes multiple ports for data transfers. There are available TLS-enabled versions of FTP and telnet daemons, however. .SS "INETD MODE" .IX Subsection "INETD MODE" The most common use of \fBstunnel\fR is to listen on a network port and establish communication with either a new port via the connect option, or a new program via the \fIexec\fR option. However there is a special case when you wish to have some other program accept incoming connections and launch \fBstunnel\fR, for example with \fIinetd\fR, \fIxinetd\fR, or \fItcpserver\fR. .PP For example, if you have the following line in \fIinetd.conf\fR: .PP .Vb 1 \& imaps stream tcp nowait root @bindir@/stunnel stunnel @sysconfdir@/stunnel/imaps.conf .Ve .PP In these cases, the \fIinetd\fR\-style program is responsible for binding a network socket (\fIimaps\fR above) and handing it to \fBstunnel\fR when a connection is received. Thus you do not want \fBstunnel\fR to have any \fIaccept\fR option. All the \fIService Level Options\fR should be placed in the global options section, and no \fI[service_name]\fR section will be present. See the \fIEXAMPLES\fR section for example configurations. .SS CERTIFICATES .IX Subsection "CERTIFICATES" Each TLS-enabled daemon needs to present a valid X.509 certificate to the peer. It also needs a private key to decrypt the incoming data. The easiest way to obtain a certificate and a key is to generate them with the free \fBOpenSSL\fR package. You can find more information on certificates generation on pages listed below. .PP The \fI.pem\fR file should contain the unencrypted private key and a signed certificate (not certificate request). So the file should look like this: .PP .Vb 6 \& \-\-\-\-\-BEGIN RSA PRIVATE KEY\-\-\-\-\- \& [encoded key] \& \-\-\-\-\-END RSA PRIVATE KEY\-\-\-\-\- \& \-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\- \& [encoded certificate] \& \-\-\-\-\-END CERTIFICATE\-\-\-\-\- .Ve .SS RANDOMNESS .IX Subsection "RANDOMNESS" \&\fBstunnel\fR needs to seed the PRNG (pseudo-random number generator) in order for TLS to use good randomness. The following sources are loaded in order until sufficient random data has been gathered: .IP \(bu 4 The file specified with the \fIRNDfile\fR flag. .IP \(bu 4 The file specified by the RANDFILE environment variable, if set. .IP \(bu 4 The file .rnd in your home directory, if RANDFILE not set. .IP \(bu 4 The file specified with '\-\-with\-random' at compile time. .IP \(bu 4 The contents of the screen if running on Windows. .IP \(bu 4 The egd socket specified with the \fIEGD\fR flag. .IP \(bu 4 The egd socket specified with '\-\-with\-egd\-sock' at compile time. .IP \(bu 4 The /dev/urandom device. .PP Note that on Windows machines that do not have console user interaction (mouse movements, creating windows, etc.) the screen contents are not variable enough to be sufficient, and you should provide a random file for use with the \fIRNDfile\fR flag. .PP Note that the file specified with the \fIRNDfile\fR flag should contain random data \-\- that means it should contain different information each time \fBstunnel\fR is run. This is handled automatically unless the \fIRNDoverwrite\fR flag is used. If you wish to update this file manually, the \fIopenssl rand\fR command in recent versions of \fBOpenSSL\fR, would be useful. .PP Important note: If /dev/urandom is available, \fBOpenSSL\fR often seeds the PRNG with it while checking the random state. On systems with /dev/urandom \&\fBOpenSSL\fR is likely to use it even though it is listed at the very bottom of the list above. This is the behaviour of \fBOpenSSL\fR and not \fBstunnel\fR. .SS "DH PARAMETERS" .IX Subsection "DH PARAMETERS" \&\fBstunnel\fR 4.40 and later contains hardcoded 2048\-bit DH parameters. Starting with \fBstunnel\fR 5.18, these hardcoded DH parameters are replaced every 24 hours with autogenerated temporary DH parameters. DH parameter generation may take several minutes. .PP Alternatively, it is possible to specify static DH parameters in the certificate file, which disables generating temporary DH parameters: .PP .Vb 1 \& openssl dhparam 2048 >> stunnel.pem .Ve .SH FILES .IX Header "FILES" .ie n .IP \fR\fI@sysconfdir\fR\fI@/stunnel/stunnel.conf\fR 4 .el .IP \fR\f(CI@sysconfdir\fR\fI@/stunnel/stunnel.conf\fR 4 .IX Item "@sysconfdir@/stunnel/stunnel.conf" \&\fBstunnel\fR configuration file .SH BUGS .IX Header "BUGS" The \fIexecArgs\fR option and the Win32 command line do not support quoting. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP \fBtcpd\fR\|(8) 4 .IX Item "tcpd" access control facility for internet services .IP \fBinetd\fR\|(8) 4 .IX Item "inetd" internet 'super\-server' .IP \fIhttp://www.stunnel.org/\fR 4 .IX Item "http://www.stunnel.org/" \&\fBstunnel\fR homepage .IP \fIhttp://www.openssl.org/\fR 4 .IX Item "http://www.openssl.org/" \&\fBOpenSSL\fR project website .SH AUTHOR .IX Header "AUTHOR" .IP "Michał Trojnara" 4 .IX Item "Michał Trojnara" <\fIMichal.Trojnara@stunnel.org\fR> stunnel-5.74/doc/stunnel.pl.8.in0000644000175000001440000016751214701524325012202 .\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "stunnel 8" .TH stunnel 8 2024.10.09 5.74 "stunnel TLS Proxy" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAZWA .IX Header "NAZWA" stunnel \- uniwersalny tunel protokołu TLS .SH SKŁADNIA .IX Header "SKŁADNIA" .IP \fBUnix:\fR 4 .IX Item "Unix:" \&\fBstunnel\fR [PLIK] | \-fd\ N | \-help | \-version | \-sockets | \-options .IP \fBWIN32:\fR 4 .IX Item "WIN32:" \&\fBstunnel\fR [ [ \-install | \-uninstall | \-start | \-stop | \-reload | \-reopen | \-exit ] [\-quiet] [PLIK] ] | \-help | \-version | \-sockets | \-options .SH OPIS .IX Header "OPIS" Program \fBstunnel\fR został zaprojektowany do opakowywania w protokół \fITLS\fR połączeń pomiędzy zdalnymi klientami a lokalnymi lub zdalnymi serwerami. Przez serwer lokalny rozumiana jest aplikacja przeznaczona do uruchamiania przy pomocy \fIinetd\fR. Stunnel pozwala na proste zestawienie komunikacji serwerów nie posiadających funkcjonalności \fITLS\fR poprzez bezpieczne kanały \fITLS\fR. .PP \&\fBstunnel\fR pozwala dodać funkcjonalność \fITLS\fR do powszechnie stosowanych demonów \fIinetd\fR, np. \fIpop3\fR lub \fIimap\fR, do samodzielnych demonów, np. \fInntp\fR, \fIsmtp\fR lub \fIhttp\fR, a nawet tunelować ppp poprzez gniazda sieciowe bez zmian w kodzie źródłowym. .SH OPCJE .IX Header "OPCJE" .IP \fBPLIK\fR 4 .IX Item "PLIK" użyj podanego pliku konfiguracyjnego .IP "\fB\-fd N\fR (tylko Unix)" 4 .IX Item "-fd N (tylko Unix)" wczytaj konfigurację z podanego deskryptora pliku .IP \fB\-help\fR 4 .IX Item "-help" drukuj listę wspieranych opcji .IP \fB\-version\fR 4 .IX Item "-version" drukuj wersję programu i domyślne wartości parametrów .IP \fB\-sockets\fR 4 .IX Item "-sockets" drukuj domyślne opcje gniazd .IP \fB\-options\fR 4 .IX Item "-options" drukuj wspierane opcje TLS .IP "\fB\-install\fR (tylko Windows NT lub nowszy)" 4 .IX Item "-install (tylko Windows NT lub nowszy)" instaluj serwis NT .IP "\fB\-uninstall\fR (tylko Windows NT lub nowszy)" 4 .IX Item "-uninstall (tylko Windows NT lub nowszy)" odinstaluj serwis NT .IP "\fB\-start\fR (tylko Windows NT lub nowszy)" 4 .IX Item "-start (tylko Windows NT lub nowszy)" uruchom serwis NT .IP "\fB\-stop\fR (tylko Windows NT lub nowszy)" 4 .IX Item "-stop (tylko Windows NT lub nowszy)" zatrzymaj serwis NT .IP "\fB\-reload\fR (tylko Windows NT lub nowszy)" 4 .IX Item "-reload (tylko Windows NT lub nowszy)" przeładuj plik konfiguracyjny uruchomionego serwisu NT .IP "\fB\-reopen\fR (tylko Windows NT lub nowszy)" 4 .IX Item "-reopen (tylko Windows NT lub nowszy)" otwórz ponownie log uruchomionego serwisu NT .IP "\fB\-exit\fR (tylko Win32)" 4 .IX Item "-exit (tylko Win32)" zatrzymaj uruchomiony program .IP "\fB\-quiet\fR (tylko Win32)" 4 .IX Item "-quiet (tylko Win32)" nie wyświetlaj okienek z komunikatami .SH "PLIK KONFIGURACYJNY" .IX Header "PLIK KONFIGURACYJNY" Linia w pliku konfiguracyjnym może być: .IP \(bu 4 pusta (ignorowana) .IP \(bu 4 komentarzem rozpoczynającym się znakiem ';' (ignorowana) .IP \(bu 4 parą 'nazwa_opcji = wartość_opcji' .IP \(bu 4 tekstem '[nazwa_usługi]' wskazującym początek definicji usługi .PP Parametr adres może być: .IP \(bu 4 numerem portu .IP \(bu 4 oddzieloną średnikiem parą adresu (IPv4, IPv6, lub nazwą domenową) i numeru portu .IP \(bu 4 ścieżką do gniazda Unix (tylko Unix) .SS "OPCJE GLOBALNE" .IX Subsection "OPCJE GLOBALNE" .IP "\fBchroot\fR = KATALOG (tylko Unix)" 4 .IX Item "chroot = KATALOG (tylko Unix)" katalog roboczego korzenia systemu plików .Sp Opcja określa katalog, w którym uwięziony zostanie proces programu \&\fBstunnel\fR tuż po jego inicjalizacji, a przed rozpoczęciem odbierania połączeń. Ścieżki podane w opcjach \fICApath\fR, \fICRLpath\fR, \fIpid\fR oraz \fIexec\fR muszą być umieszczone wewnątrz katalogu podanego w opcji \&\fIchroot\fR i określone względem tego katalogu. .Sp Niektóre funkcje systemu operacyjnego mogą wymagać dodatkowych plików umieszczonych w katalogu podanego w parametrze chroot: .RS 4 .IP \(bu 4 opóźnione rozwinięcie adresów DNS typowo wymaga /etc/nsswitch.conf i /etc/resolv.conf .IP \(bu 4 lokalizacja strefy czasowej w logach wymaga pliku /etc/timezone .IP \(bu 4 niektóre inne pliki mogą potrzebować plików urządzeń, np. /dev/zero lub /dev/null .RE .RS 4 .RE .IP "\fBcompression\fR = deflate | zlib" 4 .IX Item "compression = deflate | zlib" wybór algorytmu kompresji przesyłanych danych .Sp domyślnie: bez kompresji .Sp Algorytm deflate jest standardową metodą kompresji zgodnie z RFC 1951. .IP "\fBdebug\fR = [PODSYSTEM].POZIOM" 4 .IX Item "debug = [PODSYSTEM].POZIOM" szczegółowość logowania .Sp Poziom logowania można określić przy pomocy jednej z nazw lub liczb: emerg (0), alert (1), crit (2), err (3), warning (4), notice (5), info (6) lub debug (7). Zapisywane są komunikaty o poziomie niższym (numerycznie) lub równym podanemu. Domyślnym poziomem jest notice (5). .Sp Jakkolwiek użycie \fIdebug = debug\fR lub \fIdebug = 7\fR zapewnia najbardziej szczegółowe logi, ich zawartość jest użyteczna jedynie dla programistów zajmujących się stunnelem. Użyj tego poziomu logowania jedynie jeśli jesteś programistką/programistą stunnela, albo przygotowujesz szczegółowe informacje celem przesłania do wsparcia technicznego. W przeciwnym wypadku próba analizy zawartości logów \fBbędzie\fR jedynie źródłem dodatkowego zamieszania. .Sp O ile nie wyspecyfikowano podsystemu użyty będzie domyślny: daemon. Podsystemy nie są wspierane przez platformę Win32. .Sp Wielkość liter jest ignorowana zarówno dla poziomu jak podsystemu. .IP "\fBEGD\fR = ŚCIEŻKA_DO_EGD (tylko Unix)" 4 .IX Item "EGD = ŚCIEŻKA_DO_EGD (tylko Unix)" ścieżka do gniazda programu Entropy Gathering Daemon .Sp Opcja pozwala określić ścieżkę do gniazda programu Entropy Gathering Daemon używanego do zainicjalizowania generatora ciągów pseudolosowych biblioteki \&\fBOpenSSL\fR. .IP "\fBengine\fR = auto | IDENTYFIKATOR_URZĄDZENIA" 4 .IX Item "engine = auto | IDENTYFIKATOR_URZĄDZENIA" wybór silnika kryptograficznego .Sp domyślnie: bez wykorzystania silników kryptograficznych .Sp Sekcja PRZYKŁADY zawiera przykładowe konfiguracje wykorzystujące silniki kryptograficzne. .IP "\fBengineCtrl\fR = KOMENDA[:PARAMETR]" 4 .IX Item "engineCtrl = KOMENDA[:PARAMETR]" konfiguracja silnika kryptograficznego .IP "\fBengineDefault\fR = LISTA_ZADAŃ" 4 .IX Item "engineDefault = LISTA_ZADAŃ" lista zadań OpenSSL oddelegowanych do bieżącego silnika .Sp Parametrem jest lista oddzielonych przecinkami zadań OpenSSL, które mają zostać oddelegowane do bieżącego silnika kryptograficznego. .Sp W zależności od konkretnego silnika dostępne mogą być następujące zadania: ALL, RSA, DSA, ECDH, ECDSA, DH, RAND, CIPHERS, DIGESTS, PKEY, PKEY_CRYPTO, PKEY_ASN1. .IP "\fBfips\fR = yes | no" 4 .IX Item "fips = yes | no" tryb FIPS 140\-2 .Sp Opcja pozwala wyłączyć wejście w tryb FIPS, jeśli \fBstunnel\fR został skompilowany ze wsparciem dla FIPS 140\-2. .Sp domyślnie: no (od wersji 5.00) .IP "\fBforeground\fR = yes | quiet | no (tylko Unix)" 4 .IX Item "foreground = yes | quiet | no (tylko Unix)" tryb pierwszoplanowy .Sp Użycie tej opcji powoduje, że \fBstunnel\fR nie przechodzi w tło. .Sp Parametr \fIyes\fR powoduje dodatkowo, że komunikaty diagnostyczne logowane są na standardowy strumień błędów (stderr) oprócz wyjść zdefiniowanych przy pomocy opcji \fIsyslog\fR i \fIoutput\fR. .IP "\fBiconActive\fR = PLIK_Z_IKONKĄ (tylko GUI)" 4 .IX Item "iconActive = PLIK_Z_IKONKĄ (tylko GUI)" ikonka wyświetlana przy obecności aktywnych połączeń do usługi .Sp W systemie Windows ikonka to plik .ico zawierający obrazek 16x16 pikseli. .IP "\fBiconError\fR = PLIK_Z_IKONKĄ (tylko GUI)" 4 .IX Item "iconError = PLIK_Z_IKONKĄ (tylko GUI)" ikonka wyświetlana, jeżeli nie został załadowany poprawny plik konfiguracyjny .Sp W systemie Windows ikonka to plik .ico zawierający obrazek 16x16 pikseli. .IP "\fBiconIdle\fR = PLIK_Z_IKONKĄ (tylko GUI)" 4 .IX Item "iconIdle = PLIK_Z_IKONKĄ (tylko GUI)" ikonka wyświetlana przy braku aktywnych połączeń do usługi .Sp W systemie Windows ikonka to plik .ico zawierający obrazek 16x16 pikseli. .IP "\fBlog\fR = append | overwrite" 4 .IX Item "log = append | overwrite" obsługa logów .Sp Ta opcja pozwala określić, czy nowe logi w pliku (określonym w opcji \fIoutput\fR) będą dodawane czy nadpisywane. .Sp domyślnie: append .IP "\fBoutput\fR = PLIK" 4 .IX Item "output = PLIK" plik, do którego dopisane zostaną logi .Sp Użycie tej opcji powoduje dopisanie logów do podanego pliku. .Sp Do kierowania komunikatów na standardowe wyjście (na przykład po to, żeby zalogować je programem splogger z pakietu daemontools) można podać jako parametr urządzenie /dev/stdout. .IP "\fBpid\fR = PLIK (tylko Unix)" 4 .IX Item "pid = PLIK (tylko Unix)" położenie pliku z numerem procesu .Sp Jeżeli argument jest pusty, plik nie zostanie stworzony. .Sp Jeżeli zdefiniowano katalog \fIchroot\fR, to ścieżka do \fIpid\fR jest określona względem tego katalogu. .IP "\fBRNDbytes\fR = LICZBA_BAJTÓW" 4 .IX Item "RNDbytes = LICZBA_BAJTÓW" liczba bajtów do zainicjowania generatora pseudolosowego .IP "\fBRNDfile\fR = PLIK" 4 .IX Item "RNDfile = PLIK" ścieżka do pliku zawierającego losowe dane .Sp Biblioteka \fBOpenSSL\fR użyje danych z tego pliku do zainicjowania generatora pseudolosowego. .IP "\fBRNDoverwrite\fR = yes | no" 4 .IX Item "RNDoverwrite = yes | no" nadpisz plik nowymi wartościami pseudolosowymi .Sp domyślnie: yes (nadpisz) .IP "\fBservice\fR = SERWIS (tylko Unix)" 4 .IX Item "service = SERWIS (tylko Unix)" nazwa usługi .Sp Podana nazwa usługi będzie używana jako nazwa usługi dla inicjalizacji sysloga, oraz dla biblioteki TCP Wrapper w trybie \fIinetd\fR. Chociaż technicznie można użyć tej opcji w trybie w sekcji usług, to jest ona użyteczna jedynie w opcjach globalnych. .Sp domyślnie: stunnel .IP "\fBsyslog\fR = yes | no (tylko Unix)" 4 .IX Item "syslog = yes | no (tylko Unix)" włącz logowanie poprzez mechanizm syslog .Sp domyślnie: yes (włącz) .IP "\fBtaskbar\fR = yes | no (tylko WIN32)" 4 .IX Item "taskbar = yes | no (tylko WIN32)" włącz ikonkę w prawym dolnym rogu ekranu .Sp domyślnie: yes (włącz) .SS "OPCJE USŁUG" .IX Subsection "OPCJE USŁUG" Każda sekcja konfiguracji usługi zaczyna się jej nazwą ujętą w nawias kwadratowy. Nazwa usługi używana jest do kontroli dostępu przez bibliotekę libwrap (TCP wrappers) oraz pozwala rozróżnić poszczególne usługi w logach. .PP Jeżeli \fBstunnel\fR ma zostać użyty w trybie \fIinetd\fR, gdzie za odebranie połączenia odpowiada osobny program (zwykle \fIinetd\fR, \fIxinetd\fR lub \fItcpserver\fR), należy przeczytać sekcję \fITRYB INETD\fR poniżej. .IP "\fBaccept\fR = [HOST:]PORT" 4 .IX Item "accept = [HOST:]PORT" nasłuchuje na połączenia na podanym adresie i porcie .Sp Jeżeli nie został podany adres, \fBstunnel\fR domyślnie nasłuchuje na wszystkich adresach IPv4 lokalnych interfejsów. .Sp Aby nasłuchiwać na wszystkich adresach IPv6 należy użyć: .Sp .Vb 1 \& accept = :::port .Ve .IP "\fBCAengine\fR = IDENTYFIKATOR_CA_W_ENGINE" 4 .IX Item "CAengine = IDENTYFIKATOR_CA_W_ENGINE" ładuje zaufane certyfikaty Centrum certyfikacji z silnika .Sp Opcja pozwala określić położenie pliku zawierającego certyfikaty używane przez opcję \fIverifyChain\fR lub \fIverifyPeer\fR. .Sp Opcja może być użyta wielokrotnie w pojedynczej sekcji. .Sp Aktualnie wspierane silniki: pkcs11, cng. .IP "\fBCApath\fR = KATALOG_CA" 4 .IX Item "CApath = KATALOG_CA" ładuje zaufane certyfikaty Centrum certyfikacji z katalogu .Sp Opcja określa katalog, w którym \fBstunnel\fR będzie szukał certyfikatów, jeżeli użyta została opcja \fIverifyChain\fR lub \fIverifyPeer\fR. Pliki z certyfikatami muszą posiadać specjalne nazwy XXXXXXXX.0, gdzie XXXXXXXX jest skrótem kryptograficznym reprezentacji DER nazwy podmiotu certyfikatu. .Sp Ta opcja może być również użyta do dostarczenia certyfikatu root CA, który jest niezbędny do prawidłowej weryfikacji OCSP stapling w trybie serwera. .Sp Funkcja skrótu została zmieniona w \fBOpenSSL 1.0.0\fR. Należy wykonać c_rehash przy zmianie \fBOpenSSL 0.x.x\fR na \fB1.x.x\fR. .Sp Jeżeli zdefiniowano katalog \fIchroot\fR, to ścieżka do \fICApath\fR jest określona względem tego katalogu. .IP "\fBCAfile\fR = PLIK_CA" 4 .IX Item "CAfile = PLIK_CA" ładuje zaufane certyfikaty Centrum certyfikacji z pliku .Sp Opcja pozwala określić położenie pliku zawierającego certyfikaty używane przez opcję \fIverifyChain\fR lub \fIverifyPeer\fR. .Sp Ta opcja może być również użyta do dostarczenia certyfikatu root CA, który jest niezbędny do prawidłowej weryfikacji OCSP stapling w trybie serwera. .IP "\fBcert\fR = PLIK_CERT" 4 .IX Item "cert = PLIK_CERT" plik z łańcuchem certyfikatów .Sp Opcja określa położenie pliku zawierającego certyfikaty używane przez program \fBstunnel\fR do uwierzytelnienia się przed drugą stroną połączenia. Plik powinien zawierać kompletny łańcuch certyfikatów począwszy od certyfikatu klienta/serwera, a skończywszy na samopodpisanym certyfikacie głównego CA. Obsługiwane są pliki w formacie PEM lub P12. .Sp Certyfikat jest konieczny, aby używać programu w trybie serwera. W trybie klienta certyfikat jest opcjonalny. .Sp Jeżeli używany jest silnik kryptograficzny, to opcja \fBcert\fR pozwala wybrać identyfikator używanego certyfikatu. .IP "\fBcheckEmail\fR = EMAIL" 4 .IX Item "checkEmail = EMAIL" adres email podmiotu przedstawionego certyfikatu .Sp Pojedyncza sekcja może zawierać wiele wystąpień opcji \fBcheckEmail\fR. Certyfikaty są akceptowane, jeżeli sekcja nie weryfikuje podmiotu certyfikatu, albo adres email przedstawionego certyfikatu pasuje do jednego z adresów email określonych przy pomocy \fBcheckEmail\fR. .Sp Opcja ta wymaga biblioteki OpenSSL w wersji 1.0.2 lub nowszej. .IP "\fBcheckHost\fR = NAZWA_SERWERA" 4 .IX Item "checkHost = NAZWA_SERWERA" nazwa serwera podmiotu przedstawionego certyfikatu .Sp Pojedyncza sekcja może zawierać wiele wystąpień opcji \fBcheckHost\fR. Certyfikaty są akceptowane, jeżeli sekcja nie weryfikuje podmiotu certyfikatu, albo nazwa serwera przedstawionego certyfikatu pasuje do jednego nazw określonych przy pomocy \fBcheckHost\fR. .Sp Opcja ta wymaga biblioteki OpenSSL w wersji 1.0.2 lub nowszej. .IP "\fBcheckIP\fR = IP" 4 .IX Item "checkIP = IP" adres IP podmiotu przedstawionego certyfikatu .Sp Pojedyncza sekcja może zawierać wiele wystąpień opcji \fBcheckIP\fR. Certyfikaty są akceptowane, jeżeli sekcja nie weryfikuje podmiotu certyfikatu, albo adres IP przedstawionego certyfikatu pasuje do jednego z adresów IP określonych przy pomocy \fBcheckIP\fR. .Sp Opcja ta wymaga biblioteki OpenSSL w wersji 1.0.2 lub nowszej. .IP "\fBciphers\fR = LISTA_SZYFRÓW" 4 .IX Item "ciphers = LISTA_SZYFRÓW" lista dozwolonych szyfrów dla protokołów SSLv2, SSLv3, TLSv1, TLSv1.1, TLSv1.2 .Sp Ta opcja nie wpływa na listę parametrów kryptograficznych dla protokołu TLSv1.3 .Sp Parametrem tej opcji jest lista szyfrów, które będą użyte przy otwieraniu nowych połączeń TLS, np.: DES\-CBC3\-SHA:IDEA\-CBC\-MD5 .IP "\fBciphersuites\fR = LISTA_PARAMETRÓW_KRYPTOGRAFICZNYCH" 4 .IX Item "ciphersuites = LISTA_PARAMETRÓW_KRYPTOGRAFICZNYCH" lista dozwolonych parametrów kryptograficznych dla protokołu TLSv1.3 .Sp Parametrem tej opcji są listy parametrów kryptograficznych w kolejności ich preferowania. .Sp Począwszy od \fBOpenSSL 3.0\fR opcja \fIciphersuites\fR ignoruje nieznane szyfry. .Sp Opcja \fIciphersuites\fR jest dostępna począwszy od \fBOpenSSL 1.1.1\fR. .Sp domyślnie: TLS_CHACHA20_POLY1305_SHA256: TLS_AES_256_GCM_SHA384: TLS_AES_128_GCM_SHA256 .IP "\fBclient\fR = yes | no" 4 .IX Item "client = yes | no" tryb kliencki (zdalna usługa używa TLS) .Sp domyślnie: no (tryb serwerowy) .IP "\fBconfig\fR = KOMENDA[:PARAMETR]" 4 .IX Item "config = KOMENDA[:PARAMETR]" komenda konfiguracyjna \fBOpenSSL\fR .Sp Komenda konfiguracyjna \fBOpenSSL\fR zostaje wykonana z podanym parametrem. Pozwala to na wydawanie komend konfiguracyjnych \fBOpenSSL\fR z pliku konfiguracyjnego stunnela. Dostępne komendy opisane są w podręczniku \&\fR\f(BISSL_CONF_cmd\fR\fI\|(3ssl)\fR. .Sp Możliwe jest wyspecyfikowanie wielu opcji \fBOpenSSL\fR przez wielokrotne użycie komendy \fBconfig\fR. .Sp Zamiast wyłączać \fIconfig = Curves:list_curves\fR użyj opcji \fIcurves\fR w celu ustawienia krzywych eliptycznych. .Sp Opcja ta wymaga biblioteki OpenSSL w wersji 1.0.2 lub nowszej. .IP "\fBconnect\fR = [HOST:]PORT" 4 .IX Item "connect = [HOST:]PORT" połącz się ze zdalnym serwerem na podany port .Sp Jeżeli nie został podany adres, \fBstunnel\fR domyślnie łączy się z lokalnym serwerem. .Sp Komenda może być użyta wielokrotnie w pojedynczej sekcji celem zapewnienia wysokiej niezawodności lub rozłożenia ruchu pomiędzy wiele serwerów. .IP "\fBCRLpath\fR = KATALOG_CRL" 4 .IX Item "CRLpath = KATALOG_CRL" katalog List Odwołanych Certyfikatów (CRL) .Sp Opcja określa katalog, w którym \fBstunnel\fR będzie szukał list CRL używanych przez opcje \fIverifyChain\fR i \fIverifyPeer\fR. Pliki z listami CRL muszą posiadać specjalne nazwy XXXXXXXX.r0, gdzie XXXXXXXX jest skrótem listy CRL. .Sp Funkcja skrótu została zmieniona \fBOpenSSL 1.0.0\fR. Należy wykonać c_rehash przy zmianie \fBOpenSSL 0.x.x\fR na \fB1.x.x\fR. .Sp Jeżeli zdefiniowano katalog \fIchroot\fR, to ścieżka do \fICRLpath\fR jest określona względem tego katalogu. .IP "\fBCRLfile\fR = PLIK_CRL" 4 .IX Item "CRLfile = PLIK_CRL" plik List Odwołanych Certyfikatów (CRL) .Sp Opcja pozwala określić położenie pliku zawierającego listy CRL używane przez opcje \fIverifyChain\fR i \fIverifyPeer\fR. .IP "\fBcurves\fR = lista" 4 .IX Item "curves = lista" krzywe ECDH odddzielone ':' .Sp Wersje OpenSSL starsze niż 1.1.1 pozwalają na użycie tylko jednej krzywej. .Sp Listę dostępnych krzywych można uzyskać poleceniem: .Sp .Vb 1 \& openssl ecparam \-list_curves .Ve .Sp domyślnie: .Sp .Vb 1 \& X25519:P\-256:X448:P\-521:P\-384 (począwszy od OpenSSL 1.1.1) \& \& prime256v1 (OpenSSL starszy niż 1.1.1) .Ve .IP "\fBlogId\fR = TYP" 4 .IX Item "logId = TYP" typ identyfikatora połączenia klienta .Sp Identyfikator ten pozwala rozróżnić wpisy w logu wygenerowane dla poszczególnych połączeń. .Sp Aktualnie wspierane typy: .RS 4 .IP \fIsequential\fR 4 .IX Item "sequential" Kolejny numer połączenia jest unikalny jedynie w obrębie pojedynczej instancji programu \fBstunnel\fR, ale bardzo krótki. Jest on szczególnie użyteczny przy ręcznej analizie logów. .IP \fIunique\fR 4 .IX Item "unique" Ten rodzaj identyfikatora jest globalnie unikalny, ale znacznie dłuższy, niż kolejny numer połączenia. Jest on szczególnie użyteczny przy zautomatyzowanej analizie logów. .IP \fIthread\fR 4 .IX Item "thread" Identyfikator wątku systemu operacyjnego nie jest ani unikalny (nawet w obrębie pojedynczej instancji programu \fBstunnel\fR), ani krótki. Jest on szczególnie użyteczny przy diagnozowaniu problemów z oprogramowaniem lub konfiguracją. .IP \fIprocess\fR 4 .IX Item "process" Identyfikator procesu (PID) może być użyteczny w trybie inetd. .RE .RS 4 .Sp domyślnie: sequential .RE .IP "\fBdebug\fR = POZIOM" 4 .IX Item "debug = POZIOM" szczegółowość logowania .Sp Poziom logowania można określić przy pomocy jednej z nazw lub liczb: emerg (0), alert (1), crit (2), err (3), warning (4), notice (5), info (6) lub debug (7). Zapisywane są komunikaty o poziomie niższym (numerycznie) lub równym podanemu. Do uzyskania najwyższego poziomu szczegółowości można użyć opcji \&\fIdebug = debug\fR lub \fIdebug = 7\fR. Domyślnym poziomem jest notice (5). .IP "\fBdelay\fR = yes | no" 4 .IX Item "delay = yes | no" opóźnij rozwinięcie adresu DNS podanego w opcji \fIconnect\fR .Sp Opcja jest przydatna przy dynamicznym DNS, albo gdy usługa DNS nie jest dostępna przy starcie programu \fBstunnel\fR (klient VPN, połączenie wdzwaniane). .Sp Opóźnione rozwijanie adresu DNS jest włączane automatycznie, jeżeli nie powiedzie się rozwinięcie któregokolwiek z adresów \fIconnect\fR dla danej usługi. .Sp Opóźnione rozwijanie adresu automatycznie aktywuje \fIfailover = prio\fR. .Sp domyślnie: no .IP "\fBengineId\fR = NUMER_URZĄDZENIA" 4 .IX Item "engineId = NUMER_URZĄDZENIA" wybierz silnik kryptograficzny dla usługi .IP "\fBengineNum\fR = NUMER_URZĄDZENIA" 4 .IX Item "engineNum = NUMER_URZĄDZENIA" wybierz silnik kryptograficzny dla usługi .Sp Urządzenia są numerowane od 1 w górę. .IP "\fBexec\fR = ŚCIEŻKA_DO_PROGRAMU" 4 .IX Item "exec = ŚCIEŻKA_DO_PROGRAMU" wykonaj lokalny program przystosowany do pracy z superdemonem inetd .Sp Jeżeli zdefiniowano katalog \fIchroot\fR, to ścieżka do \fIexec\fR jest określona względem tego katalogu. .Sp Na platformach Unix ustawiane są następujące zmienne środowiskowe: REMOTE_HOST, REMOTE_PORT, SSL_CLIENT_DN, SSL_CLIENT_I_DN. .ie n .IP "\fBexecArgs\fR = $0 $1 $2 ..." 4 .el .IP "\fBexecArgs\fR = \f(CW$0\fR \f(CW$1\fR \f(CW$2\fR ..." 4 .IX Item "execArgs = $0 $1 $2 ..." argumenty do opcji \fIexec\fR włącznie z nazwą programu ($0) .Sp Cytowanie nie jest wspierane w obecnej wersji programu. Argumenty są rozdzielone dowolną liczbą białych znaków. .IP "\fBfailover\fR = rr | prio" 4 .IX Item "failover = rr | prio" Strategia wybierania serwerów wyspecyfikowanych parametrami "connect". .RS 4 .IP \fIrr\fR 4 .IX Item "rr" round robin \- sprawiedliwe rozłożenie obciążenia .IP \fIprio\fR 4 .IX Item "prio" priority \- użyj kolejności opcji w pliku konfiguracyjnym .RE .RS 4 .Sp domyślnie: prio .RE .IP "\fBident\fR = NAZWA_UŻYTKOWNIKA" 4 .IX Item "ident = NAZWA_UŻYTKOWNIKA" weryfikuj nazwę zdalnego użytkownika korzystając z protokołu IDENT (RFC 1413) .IP "\fBinclude\fR = KATALOG" 4 .IX Item "include = KATALOG" wczytaj fragmenty plików konfiguracyjnych z podanego katalogu .Sp Pliki są wczytywane w rosnącej kolejności alfabetycznej ich nazw. Rekomendowana konwencja nazewnictwa plików .Sp dla opcji globalnych: .Sp .Vb 1 \& 00\-global.conf .Ve .Sp dla lokalnych opcji usług: .Sp .Vb 1 \& 01\-service.conf \& \& 02\-service.conf .Ve .IP "\fBkey\fR = PLIK_KLUCZA" 4 .IX Item "key = PLIK_KLUCZA" klucz prywatny do certyfikatu podanego w opcji \fIcert\fR .Sp Klucz prywatny jest potrzebny do uwierzytelnienia właściciela certyfikatu. Ponieważ powinien on być zachowany w tajemnicy, prawa do jego odczytu powinien mieć wyłącznie właściciel pliku. W systemie Unix można to osiągnąć komendą: .Sp .Vb 1 \& chmod 600 keyfile .Ve .Sp Jeżeli używany jest silnik kryptograficzny, to opcja \fBkey\fR pozwala wybrać identyfikator używanego klucza prywatnego. .Sp domyślnie: wartość opcji \fIcert\fR .IP "\fBlibwrap\fR = yes | no" 4 .IX Item "libwrap = yes | no" włącz lub wyłącz korzystanie z /etc/hosts.allow i /etc/hosts.deny. .Sp domyślnie: no (od wersji 5.00) .IP "\fBlocal\fR = HOST" 4 .IX Item "local = HOST" IP źródła do nawiązywania zdalnych połączeń .Sp Domyślnie używane jest IP najbardziej zewnętrznego interfejsu w stronę serwera, do którego nawiązywane jest połączenie. .IP "\fBOCSP\fR = URL" 4 .IX Item "OCSP = URL" responder OCSP do weryfikacji certyfikatu drugiej strony połączenia .IP "\fBOCSPaia\fR = yes | no" 4 .IX Item "OCSPaia = yes | no" weryfikuj certyfikaty przy użyciu respondertów AIA .Sp Opcja \fIOCSPaia\fR pozwala na weryfikowanie certyfikatów przy pomocy listy URLi responderów OCSP przesłanych w rozszerzeniach AIA (Authority Information Access). .IP "\fBOCSPflag\fR = FLAGA_OCSP" 4 .IX Item "OCSPflag = FLAGA_OCSP" flaga respondera OCSP .Sp Aktualnie wspierane flagi: NOCERTS, NOINTERN, NOSIGS, NOCHAIN, NOVERIFY, NOEXPLICIT, NOCASIGN, NODELEGATED, NOCHECKS, TRUSTOTHER, RESPID_KEY, NOTIME .Sp Aby wyspecyfikować kilka flag należy użyć \fIOCSPflag\fR wielokrotnie. .IP "\fBOCSPnonce\fR = yes | no" 4 .IX Item "OCSPnonce = yes | no" wysyłaj i weryfikuj OCSP nonce .Sp Opcja \fBOCSPnonce\fR zabezpiecza protokół OCSP przed atakami powtórzeniowymi. Ze względu na złożoność obliczeniową rozszerzenie nonce jest zwykle wspierane jedynie przez wewnętrzne (np. korporacyjne), a nie przez publiczne respondery OCSP. .IP "\fBOCSPrequire\fR = yes | no" 4 .IX Item "OCSPrequire = yes | no" wymagaj rozstrzygającej odpowiedzi respondera OCSP .IP "\fBOCSPrequire\fR = yes | no" 4 .IX Item "OCSPrequire = yes | no" Wyłączenie tej opcji pozwala na zaakceptowanie połączenia pomimo braku otrzymania rozstrzygającej odpowiedzi OCSP ze staplingu i bezpośredniego żądania wysłanego do respondera. .Sp default: yes .Sp domyślnie: yes .IP "\fBoptions\fR = OPCJE_SSL" 4 .IX Item "options = OPCJE_SSL" opcje biblioteki \fBOpenSSL\fR .Sp Parametrem jest nazwa opcji zgodnie z opisem w \fR\f(BISSL_CTX_set_options\fR\fI\|(3ssl)\fR, ale bez przedrostka \fISSL_OP_\fR. \&\fIstunnel \-options\fR wyświetla opcje dozwolone w aktualnej kombinacji programu \fIstunnel\fR i biblioteki \fIOpenSSL\fR. .Sp Aby wyspecyfikować kilka opcji należy użyć \fIoptions\fR wielokrotnie. Nazwa opcji może być poprzedzona myślnikiem ("\-") celem wyłączenia opcji. .Sp Na przykład, dla zachowania kompatybilności z błędami implementacji TLS w programie Eudora, można użyć opcji: .Sp .Vb 1 \& options = DONT_INSERT_EMPTY_FRAGMENTS .Ve .Sp domyślnie: .Sp .Vb 2 \& options = NO_SSLv2 \& options = NO_SSLv3 .Ve .Sp Począwszy od \fBOpenSSL 1.1.0\fR, zamiast wyłączać określone wersje protokołów TLS użyj opcji \fIsslVersionMax\fR lub \fIsslVersionMin\fR. .IP "\fBprotocol\fR = PROTOKÓŁ" 4 .IX Item "protocol = PROTOKÓŁ" negocjuj TLS podanym protokołem aplikacyjnym .Sp Opcja ta włącza wstępną negocjację szyfrowania TLS dla wybranego protokołu aplikacyjnego. Opcji \fIprotocol\fR nie należy używać z szyfrowaniem TLS na osobnym porcie. .Sp Aktualnie wspierane protokoły: .RS 4 .IP \fIcifs\fR 4 .IX Item "cifs" Nieudokumentowane rozszerzenie protokołu CIFS wspierane przez serwer Samba. Wsparcie dla tego rozszerzenia zostało zarzucone w wersji 3.0.0 serwera Samba. .IP \fIcapwin\fR 4 .IX Item "capwin" Wsparcie dla aplikacji http://www.capwin.org/ .IP \fIcapwinctrl\fR 4 .IX Item "capwinctrl" Wsparcie dla aplikacji http://www.capwin.org/ .Sp Ten protokół jest wspierany wyłącznie w trybie klienckim. .IP \fIconnect\fR 4 .IX Item "connect" Negocjacja RFC 2817 \- \fIUpgrading to TLS Within HTTP/1.1\fR, rozdział 5.2 \- \fIRequesting a Tunnel with CONNECT\fR .Sp Ten protokół jest wspierany wyłącznie w trybie klienckim. .IP \fIimap\fR 4 .IX Item "imap" Negocjacja RFC 2595 \- \fIUsing TLS with IMAP, POP3 and ACAP\fR .IP \fIldap\fR 4 .IX Item "ldap" Negocjacja RFC 2830 \- \fILightweight Directory Access Protocol (v3): Extension for Transport Layer Security\fR .IP \fInntp\fR 4 .IX Item "nntp" Negocjacja RFC 4642 \- \fIUsing Transport Layer Security (TLS) with Network News Transfer Protocol (NNTP)\fR .Sp Ten protokół jest wspierany wyłącznie w trybie klienckim. .IP \fIpgsql\fR 4 .IX Item "pgsql" Negocjacja \fIhttp://www.postgresql.org/docs/8.3/static/protocol\-flow.html#AEN73982\fR .IP \fIpop3\fR 4 .IX Item "pop3" Negocjacja RFC 2449 \- \fIPOP3 Extension Mechanism\fR .IP \fIproxy\fR 4 .IX Item "proxy" Przekazywanie oryginalnego IP klienta przez protokół HAProxy PROXY w wersji 1 \&\fIhttps://www.haproxy.org/download/1.8/doc/proxy\-protocol.txt\fR .IP \fIsmtp\fR 4 .IX Item "smtp" Negocjacja RFC 2487 \- \fISMTP Service Extension for Secure SMTP over TLS\fR .IP \fIsocks\fR 4 .IX Item "socks" Wspierany jest protokół SOCKS w wersjach 4, 4a i 5. Protokół SOCKS enkapsulowany jest w protokole TLS, więc adres serwera docelowego nie jest widoczny dla napastnika przechwytującego ruch sieciowy. .Sp \&\fIhttp://www.openssh.com/txt/socks4.protocol\fR .Sp \&\fIhttp://www.openssh.com/txt/socks4a.protocol\fR .Sp Nie jest wspierana komenda BIND protokołu SOCKS. Przesłana wartość parametru USERID jest ignorowana. .Sp Sekcja PRZYKŁADY zawiera przykładowe pliki konfiguracyjne VPNa zbudowanego w oparciu o szyfrowany protokół SOCKS. .RE .RS 4 .RE .IP "\fBprotocolAuthentication\fR = UWIERZYTELNIENIE" 4 .IX Item "protocolAuthentication = UWIERZYTELNIENIE" rodzaj uwierzytelnienia do negocjacji protokołu .Sp Opcja ta jest wpierana wyłącznie w klienckich protokołach 'connect' i 'smtp'. .Sp W protokole 'connect' wspierane jest uwierzytelnienie 'basic' oraz 'ntlm'. Domyślnym rodzajem uwierzytelnienia protokołu 'connect' jest 'basic'. .Sp W protokole 'smtp' wspierane jest uwierzytelnienie 'plain' oraz 'login'. Domyślnym rodzajem uwierzytelnienia protokołu 'smtp' jest 'plain'. .IP "\fBprotocolDomain\fR = DOMENA" 4 .IX Item "protocolDomain = DOMENA" domena do negocjacji protokołu .Sp W obecnej wersji opcja ma zastosowanie wyłącznie w protokole 'connect'. .IP "\fBprotocolHeader\fR = NAGŁÓWEK" 4 .IX Item "protocolHeader = NAGŁÓWEK" nagłówek do negocjacji protokołu .Sp W obecnej wersji opcja ma zastosowanie wyłącznie w protokole 'connect'. .IP "\fBprotocolHost\fR = ADRES" 4 .IX Item "protocolHost = ADRES" adres hosta do negocjacji protokołu .Sp Dla protokołu 'connect', \fIprotocolHost\fR określa docelowy serwer TLS, do którego połączyć ma się proxy. Adres serwera proxy, do którego łączy się \&\fBstunnel\fR, musi być określony przy pomocy opcji \fIconnect\fR. .Sp Dla protokołu 'smtp', \fIprotocolHost\fR określa wartość HELO/EHLO wysyłanego przy negocjacji klienta. .IP "\fBprotocolPassword\fR = HASŁO" 4 .IX Item "protocolPassword = HASŁO" hasło do negocjacji protokołu .Sp Opcja ta jest wspierana wyłącznie w klienckich protokołach 'connect' i 'smtp'. .IP "\fBprotocolUsername\fR = UŻYTKOWNIK" 4 .IX Item "protocolUsername = UŻYTKOWNIK" nazwa użytkownika do negocjacji protokołu .Sp Opcja ta jest wspierana wyłącznie w klienckich protokołach 'connect' i 'smtp'. .IP "\fBPSKidentity\fR = TOŻSAMOŚĆ" 4 .IX Item "PSKidentity = TOŻSAMOŚĆ" tożsamość klienta PSK .Sp \&\fIPSKidentity\fR może zostać użyte w sekcjach klienckich do wybrania tożsamości użytej do uwierzytelnienia PSK. Opcja jest ignorowana w sekcjach serwerowych. .Sp domyślnie: pierwsza tożsamość zdefiniowana w pliku \fIPSKsecrets\fR .IP "\fBPSKsecrets\fR = PLIK" 4 .IX Item "PSKsecrets = PLIK" plik z tożsamościami i kluczami PSK .Sp Każda linia pliku jest w następującym formacie: .Sp .Vb 1 \& TOŻSAMOŚĆ:KLUCZ .Ve .Sp Szesnastkowe klucze są automatycznie konwertowane do postaci binarnej. Klucz musi być mieć przynajmniej 16 bajtów, co w przypadku kluczy szesnastkowych przekłada się na przynajmniej 32 znaki. Należy ograniczyć dostęp do czytania lub pisania do tego pliku. .IP "\fBpty\fR = yes | no (tylko Unix)" 4 .IX Item "pty = yes | no (tylko Unix)" alokuj pseudo-terminal dla programu uruchamianego w opcji 'exec' .IP "\fBredirect\fR = [HOST:]PORT" 4 .IX Item "redirect = [HOST:]PORT" przekieruj klienta, któremu nie udało się poprawnie uwierzytelnić przy pomocy certyfikatu .Sp Opcja działa wyłącznie w trybie serwera. Część negocjacji protokołów jest niekompatybilna z opcją \fIredirect\fR. .IP "\fBrenegotiation\fR = yes | no" 4 .IX Item "renegotiation = yes | no" pozwalaj na renegocjację TLS .Sp Zastosowania renegocjacji TLS zawierają niektóre scenariusze uwierzytelniania oraz renegocjację kluczy dla długotrwałych połączeń. .Sp Z drugiej strony własność na może ułatwić trywialny atak DoS poprzez wygenerowanie obciążenia procesora: .Sp http://vincent.bernat.im/en/blog/2011\-ssl\-dos\-mitigation.html .Sp Warto zauważyć, że zablokowanie renegocjacji TLS nie zabezpiecza w pełni przed opisanym problemem. .Sp domyślnie: yes (o ile wspierane przez \fBOpenSSL\fR) .IP "\fBreset\fR = yes | no" 4 .IX Item "reset = yes | no" sygnalizuj wystąpienie błędu przy pomocy flagi TCP RST .Sp Opcja nie jest wspierana na niektórych platformach. .Sp domyślnie: yes .IP "\fBretry\fR = yes | no | OPÓŹNIENIE" 4 .IX Item "retry = yes | no | OPÓŹNIENIE" połącz ponownie sekcję connect+exec po rozłączeniu .Sp Wartość parametru OPÓŹNIENIE określa liczbę milisekund oczekiwania przed wykonaniem ponownego połączenia. "retry = yes" jest synonimem dla "retry = 1000". .Sp domyślnie: no .IP "\fBsecurityLevel\fR = POZIOM" 4 .IX Item "securityLevel = POZIOM" ustaw poziom bezpieczeństwa .Sp Znaczenie każdego poziomu opisano poniżej: .RS 4 .IP "poziom 0" 4 .IX Item "poziom 0" Wszystko jest dozwolone. .IP "poziom 1" 4 .IX Item "poziom 1" Poziom bezpieczeństwa zapewniający minimum 80 bitów bezpieczeństwa. Żadne parametry kryptograficzne oferujące poziom bezpieczeństwa poniżej 80 bitów nie mogą zostać użyte. W związku z tym RSA, DSA oraz klucze DH krótsze niż 1024 bity, a także klucze ECC krótsze niż 160 bitów i wszystkie eksportowe zestawy szyfrów są niedozwolone. Użycie SSLv2 jest zabronione. Wszelkie listy parametrów kryptograficznych używające MD5 do MAC są zabronione. Począwszy od OpenSSL 3.0 wersje TLS starsze niż 1.2 są wyłączone. .IP "poziom 2" 4 .IX Item "poziom 2" Poziom bezpieczeństwa zapewniający 112 bitów bezpieczeństwa. W związku z tym RSA, DSA oraz klucze DH krótsze niż 2048 bitów, a także klucze ECC krótsze niż 224 bity są niedozwolone. Oprócz wyłączeń z poziomu 1 zabronione jest także korzystanie z zestawów szyfrów używających RC4. Kompresja jest wyłączona. Użycie SSLv3 jest zabronione dla wersji OpenSSL starszych niż 3.0. .IP "poziom 3" 4 .IX Item "poziom 3" Poziom bezpieczeństwa zapewniający 128 bitów bezpieczeństwa. W związku z tym RSA, DSA oraz klucze DH krótsze niż 3072 bity, a także klucze ECC krótsze niż 256 bitów są niedozwolone. Oprócz wyłączeń z poziomu 2 zabronione jest także korzystanie z zestawów szyfrów nie zapewniających utajniania z wyprzedzeniem (forward secrecy). Bilety sesji są wyłączone. Wersje TLS starsze niż 1.1 są zabronione dla wersji OpenSSL starszych niż 3.0. .IP "poziom 4" 4 .IX Item "poziom 4" Poziom bezpieczeństwa zapewniający 192 bity bezpieczeństwa. W związku z tym RSA, DSA oraz klucze DH krótsze niż 7680 bitów, a także klucze ECC krótsze niż 384 bity są niedozwolone. Listy parametrów kryptograficznych używających SHA1 do MAC są zabronione. Wersje TLS starsze niż 1.2 są zabronione dla wersji OpenSSL starszych niż 3.0. .IP "poziom 5" 4 .IX Item "poziom 5" Poziom bezpieczeństwa zapewniający 256 bitów bezpieczeństwa. W związku z tym RSA, DSA oraz klucze DH krótsze niż 15360 bitów, a także klucze ECC krótsze niż 512 bitów są niedozwolone. .IP "domyślnie: 2" 4 .IX Item "domyślnie: 2" .RE .RS 4 .Sp Opcja \fIsecurityLevel\fR jest dostępna począwszy od \fBOpenSSL 1.1.0\fR. .RE .IP "\fBrequireCert\fR = yes | no" 4 .IX Item "requireCert = yes | no" wymagaj certyfikatu klienta dla \fIverifyChain\fR lub \fIverifyPeer\fR .Sp Przy opcji \fIrequireCert\fR ustawionej na \fIno\fR, \fBstunnel\fR akceptuje połączenia klientów, które nie wysłały certyfikatu. .Sp Zarówno \fIverifyChain = yes\fR jak i \fIverifyPeer = yes\fR automatycznie ustawiają \fIrequireCert\fR na \fIyes\fR. .Sp domyślnie: no .IP "\fBsetgid\fR = IDENTYFIKATOR_GRUPY (tylko Unix)" 4 .IX Item "setgid = IDENTYFIKATOR_GRUPY (tylko Unix)" identyfikator grupy Unix .Sp Jako opcja globalna: grupa, z której prawami pracował będzie \fBstunnel\fR. .Sp Jako opcja usługi: grupa gniazda Unix utworzonego przy pomocy opcji "accept". .IP "\fBsetuid\fR = IDENTYFIKATOR_UŻYTKOWNIKA (tylko Unix)" 4 .IX Item "setuid = IDENTYFIKATOR_UŻYTKOWNIKA (tylko Unix)" identyfikator użytkownika Unix .Sp Jako opcja globalna: użytkownik, z którego prawami pracował będzie \fBstunnel\fR. .Sp Jako opcja usługi: właściciel gniazda Unix utworzonego przy pomocy opcji "accept". .IP "\fBsessionCacheSize\fR = LICZBA_POZYCJI_CACHE" 4 .IX Item "sessionCacheSize = LICZBA_POZYCJI_CACHE" rozmiar pamięci podręcznej sesji TLS .Sp Parametr określa maksymalną liczbę pozycji wewnętrznej pamięci podręcznej sesji. .Sp Wartość 0 oznacza brak ograniczenia rozmiaru. Nie jest to zalecane dla systemów produkcyjnych z uwagi na ryzyko ataku DoS przez wyczerpanie pamięci RAM. .IP "\fBsessionCacheTimeout\fR = LICZBA_SEKUND" 4 .IX Item "sessionCacheTimeout = LICZBA_SEKUND" przeterminowanie pamięci podręcznej sesji TLS .Sp Parametr określa czas w sekundach, po którym sesja TLS zostanie usunięta z pamięci podręcznej. .IP "\fBsessionResume\fR = yes | no" 4 .IX Item "sessionResume = yes | no" zezwalaj lub nie zezwalaj na wznawianie sesji .Sp domyślnie: yes .IP "\fBsessiond\fR = HOST:PORT" 4 .IX Item "sessiond = HOST:PORT" adres sessiond \- serwera cache sesji TLS .IP "\fBsni\fR = NAZWA_USŁUGI:WZORZEC_NAZWY_SERWERA (tryb serwera)" 4 .IX Item "sni = NAZWA_USŁUGI:WZORZEC_NAZWY_SERWERA (tryb serwera)" Użyj usługi jako podrzędnej (virtualnego serwera) dla rozszerzenia TLS Server Name Indication (RFC 3546). .Sp \&\fINAZWA_USŁUGI\fR wskazuje usługę nadrzędną, która odbiera połączenia od klientów przy pomocy opcji \fIaccept\fR. \fIWZORZEC_NAZWY_SERWERA\fR wskazuje nazwę serwera wirtualnego. Wzorzec może zaczynać się znakiem '*', np. '*.example.com". Z pojedynczą usługą nadrzędną powiązane jest zwykle wiele usług podrzędnych. Opcja \fIsni\fR może być również użyta wielokrotnie w ramach jednej usługi podrzędnej. .Sp Zarówno usługa nadrzędna jak i podrzędna nie może być skonfigurowana w trybie klienckim. .Sp Opcja \fIconnect\fR usługi podrzędnej jest ignorowana w połączeniu z opcją \&\fIprotocol\fR, gdyż połączenie do zdalnego serwera jest w tym wypadku nawiązywane przed negocjacją TLS. .Sp Uwierzytelnienie przy pomocy biblioteki libwrap jest realizowane dwukrotnie: najpierw dla usługi nadrzędnej po odebraniu połączenia TCP, a następnie dla usługi podrzędnej podczas negocjacji TLS. .Sp Opcja \fIsni\fR jest dostępna począwszy od \fBOpenSSL 1.0.0\fR. .IP "\fBsni\fR = NAZWA_SERWERA (tryb klienta)" 4 .IX Item "sni = NAZWA_SERWERA (tryb klienta)" Użyj parametru jako wartości rozszerzenia TLS Server Name Indication (RFC 3546). .Sp Pusta wartość parametru NAZWA_SERWERA wyłącza wysyłanie rozszerzenia SNI. .Sp Opcja \fIsni\fR jest dostępna począwszy od \fBOpenSSL 1.0.0\fR. .IP "\fBsocket\fR = a|l|r:OPCJA=WARTOŚĆ[:WARTOŚĆ]" 4 .IX Item "socket = a|l|r:OPCJA=WARTOŚĆ[:WARTOŚĆ]" ustaw opcję na akceptującym/lokalnym/zdalnym gnieździe .Sp Dla opcji linger wartości mają postać l_onof:l_linger. Dla opcji time wartości mają postać tv_sec:tv_usec. .Sp Przykłady: .Sp .Vb 10 \& socket = l:SO_LINGER=1:60 \& ustaw jednominutowe przeterminowanie \& przy zamykaniu lokalnego gniazda \& socket = r:SO_OOBINLINE=yes \& umieść dane pozapasmowe (out\-of\-band) \& bezpośrednio w strumieniu danych \& wejściowych dla zdalnych gniazd \& socket = a:SO_REUSEADDR=no \& zablokuj ponowne używanie portu \& (domyślnie włączone) \& socket = a:SO_BINDTODEVICE=lo \& przyjmuj połączenia wyłącznie na \& interfejsie zwrotnym (ang. loopback) .Ve .IP "\fBsslVersion\fR = WERSJA_SSL" 4 .IX Item "sslVersion = WERSJA_SSL" wersja protokołu TLS .Sp Wspierane wersje: all, SSLv2, SSLv3, TLSv1, TLSv1.1, TLSv1.2, TLSv1.3 .Sp Dostępność konkretnych protokołów zależy od użytej wersji OpenSSL. Starsze wersje OpenSSL nie wspierają TLSv1.1, TLSv1.2, TLSv1.3. Nowsze wersje OpenSSL nie wspierają SSLv2. .Sp Przestarzałe protokoły SSLv2 i SSLv3 są domyślnie wyłączone. .Sp Począwszy od \fBOpenSSL 1.1.0\fR, ustawienie .Sp .Vb 1 \& sslVersion = WERSJA_SSL .Ve .Sp jest równoważne opcjom .Sp .Vb 2 \& sslVersionMax = WERSJA_SSL \& sslVersionMin = WERSJA_SSL .Ve .IP "\fBsslVersionMax\fR = WERSJA_SSL" 4 .IX Item "sslVersionMax = WERSJA_SSL" maksymalna wspierana wersja protokołu TLS .Sp Wspierane wersje: all, SSLv3, TLSv1, TLSv1.1, TLSv1.2, TLSv1.3 .Sp \&\fIall\fR włącza wszystkie wersje protokołów aż do maksymalnej wersji wspieranej przez bibliotekę użytej wersji OpenSSL. .Sp Dostępność konkretnych protokołów zależy od użytej wersji OpenSSL. .Sp Opcja \fIsslVersionMax\fR jest dostępna począwszy od \fBOpenSSL 1.1.0\fR. .Sp domyślnie: all .IP "\fBsslVersionMin\fR = WERSJA_SSL" 4 .IX Item "sslVersionMin = WERSJA_SSL" minimalna wspierana wersja protokołu TLS .Sp Wspierane wersje: all, SSLv3, TLSv1, TLSv1.1, TLSv1.2, TLSv1.3 .Sp \&\fIall\fR włącza wszystkie wersje protokołów aż do minimalnej wersji wspieranej przez bibliotekę użytej wersji OpenSSL. .Sp Dostępność konkretnych protokołów zależy od użytej wersji OpenSSL. .Sp Opcja \fIsslVersionMin\fR jest dostępna począwszy od \fBOpenSSL 1.1.0\fR. .Sp domyślnie: TLSv1 .IP "\fBstack\fR = LICZBA_BAJTÓW (z wyjątkiem modelu FORK)" 4 .IX Item "stack = LICZBA_BAJTÓW (z wyjątkiem modelu FORK)" rozmiar stosu procesora tworzonych wątków .Sp Zbyt duży stos zwiększa zużycie pamięci wirtualnej. Zbyt mały stos może powodować problemy ze stabilnością aplikacji. .Sp domyślnie: 65536 bytes (wystarczający dla testowanych platform) .IP "\fBticketKeySecret\fR = SECRET" 4 .IX Item "ticketKeySecret = SECRET" szesnastkowy klucz symetryczny używany przez serwer do zapewnienia poufności biletów sesji .Sp Bilety sesji zdefiniowane w RFC 5077 zapewniają ulepszoną możliwość wznawiania sesji, w której implementacja serwera nie jest wymagana do utrzymania stanu sesji. .Sp Łączne użycie opcji \fIticketKeySecret\fR i \fIticketMacSecret\fR umożliwia wznawianie sesji na klastrze serwerów lub wznowienie sesji po restarcie serwera. .Sp Klucz musi mieć rozmiar 16 lub 32 bajtów, co przekłada się na dokładnie 32 lub 64 cyfry szesnastkowe. Poszczególne bajty mogą być opcjonalnie oddzielone dwukropkami. .Sp Opcja działa wyłącznie w trybie serwera. .Sp Opcja \fIticketKeySecret\fR jest dostępna począwszy od \fBOpenSSL 1.0.0\fR. .Sp Wyłączenie opcji \fINO_TICKET\fR jest wymagane dla obsługi biletów sesji w OpenSSL-u starszym niż 1.1.1, ale opcja ta jest niekompatybilna z opcją \&\fIredirect\fR. .IP "\fBticketMacSecret\fR = SECRET" 4 .IX Item "ticketMacSecret = SECRET" szesnastkowy klucz symetryczny używany przez serwer zapewnienia integralności biletów sesji .Sp Klucz musi mieć rozmiar 16 lub 32 bajtów, co przekłada się na dokładnie 32 lub 64 cyfry szesnastkowe. Poszczególne bajty mogą być opcjonalnie oddzielone dwukropkami. .Sp Opcja działa wyłącznie w trybie serwera. .Sp Opcja \fIticketMacSecret\fR jest dostępna począwszy od \fBOpenSSL 1.0.0\fR. .IP "\fBTIMEOUTbusy\fR = LICZBA_SEKUND" 4 .IX Item "TIMEOUTbusy = LICZBA_SEKUND" czas oczekiwania na spodziewane dane .IP "\fBTIMEOUTclose\fR = LICZBA_SEKUND" 4 .IX Item "TIMEOUTclose = LICZBA_SEKUND" czas oczekiwania na close_notify (ustaw na 0, jeżeli klientem jest MSIE) .IP "\fBTIMEOUTconnect\fR = LICZBA_SEKUND" 4 .IX Item "TIMEOUTconnect = LICZBA_SEKUND" czas oczekiwania na nawiązanie połączenia .IP "\fBTIMEOUTidle\fR = LICZBA_SEKUND" 4 .IX Item "TIMEOUTidle = LICZBA_SEKUND" maksymalny czas utrzymywania bezczynnego połączenia .IP "\fBTIMEOUTocsp\fR = LICZBA_SEKUND" 4 .IX Item "TIMEOUTocsp = LICZBA_SEKUND" czas oczekiwania na nawiązanie połączenia z serwerem OCSP .IP "\fBtransparent\fR = none | source | destination | both (tylko Unix)" 4 .IX Item "transparent = none | source | destination | both (tylko Unix)" tryb przezroczystego proxy na wspieranych platformach .Sp Wspierane wartości: .RS 4 .IP \fBnone\fR 4 .IX Item "none" Zablokuj wsparcie dla przezroczystego proxy. Jest to wartość domyślna. .IP \fBsource\fR 4 .IX Item "source" Przepisz adres, aby nawiązywane połączenie wydawało się pochodzić bezpośrednio od klienta, a nie od programu \fBstunnel\fR. .Sp Opcja jest aktualnie obsługiwana w: .RS 4 .IP "Trybie zdalnym (opcja \fIconnect\fR) w systemie \fILinux >=2.6.28\fR" 4 .IX Item "Trybie zdalnym (opcja connect) w systemie Linux >=2.6.28" Konfiguracja wymaga następujących ustawień iptables oraz routingu (na przykład w pliku /etc/rc.local lub analogicznym): .Sp .Vb 7 \& iptables \-t mangle \-N DIVERT \& iptables \-t mangle \-A PREROUTING \-p tcp \-m socket \-j DIVERT \& iptables \-t mangle \-A DIVERT \-j MARK \-\-set\-mark 1 \& iptables \-t mangle \-A DIVERT \-j ACCEPT \& ip rule add fwmark 1 lookup 100 \& ip route add local 0.0.0.0/0 dev lo table 100 \& echo 0 >/proc/sys/net/ipv4/conf/lo/rp_filter .Ve .Sp Konfiguracja ta wymaga, aby \fBstunnel\fR był wykonywany jako root i bez opcji \fIsetuid\fR. .IP "Trybie zdalnym (opcja \fIconnect\fR) w systemie \fILinux 2.2.x\fR" 4 .IX Item "Trybie zdalnym (opcja connect) w systemie Linux 2.2.x" Konfiguracja ta wymaga skompilowania jądra z opcją \fItransparent proxy\fR. Docelowa usługa musi być umieszczona na osobnej maszynie, do której routing kierowany jest poprzez serwer \fBstunnela\fR. .Sp Dodatkowo \fBstunnel\fR powinien być wykonywany jako root i bez opcji \fIsetuid\fR. .IP "Trybie zdalnym (opcja \fIconnect\fR) w systemie \fIFreeBSD >=8.0\fR" 4 .IX Item "Trybie zdalnym (opcja connect) w systemie FreeBSD >=8.0" Konfiguracja ta wymaga skonfigurowania firewalla i routingu. \&\fBstunnel\fR musi być wykonywany jako root i bez opcji \fIsetuid\fR. .IP "Trybie lokalnym (opcja \fIexec\fR)" 4 .IX Item "Trybie lokalnym (opcja exec)" Konfiguracja ta jest realizowana przy pomocy biblioteki \fIlibstunnel.so\fR. Do załadowania biblioteki wykorzystywana jest zmienna środowiskowa _RLD_LIST na platformie Tru64 lub LD_PRELOAD na innych platformach. .RE .RS 4 .RE .IP \fIdestination\fR 4 .IX Item "destination" Oryginalny adres docelowy jest używany zamiast opcji \fIconnect\fR. .Sp Przykładowa konfiguracja przezroczystego adresu docelowego: .Sp .Vb 4 \& [transparent] \& client = yes \& accept = \& transparent = destination .Ve .Sp Konfiguracja wymaga ustawień iptables, na przykład w pliku /etc/rc.local lub analogicznym. .Sp W przypadku docelowej usługi umieszczonej na tej samej maszynie: .Sp .Vb 3 \& /sbin/iptables \-t nat \-I OUTPUT \-p tcp \-\-dport \e \& \-m ! \-\-uid\-owner \e \& \-j DNAT \-\-to\-destination : .Ve .Sp W przypadku docelowej usługi umieszczonej na zdalnej maszynie: .Sp .Vb 3 \& /sbin/iptables \-I INPUT \-i eth0 \-p tcp \-\-dport \-j ACCEPT \& /sbin/iptables \-t nat \-I PREROUTING \-p tcp \-\-dport \e \& \-i eth0 \-j DNAT \-\-to\-destination : .Ve .Sp Przezroczysty adres docelowy jest aktualnie wspierany wyłącznie w systemie Linux. .IP \fIboth\fR 4 .IX Item "both" Użyj przezroczystego proxy zarówno dla adresu źródłowego jak i docelowego. .RE .RS 4 .Sp Dla zapewnienia kompatybilności z wcześniejszymi wersjami wspierane są dwie dodatkowe opcje: .IP \fIyes\fR 4 .IX Item "yes" Opcja została przemianowana na \fIsource\fR. .IP \fIno\fR 4 .IX Item "no" Opcja została przemianowana na \fInone\fR. .RE .RS 4 .RE .IP "\fBverify\fR = POZIOM" 4 .IX Item "verify = POZIOM" weryfikuj certyfikat drugiej strony połączenia .Sp Opcja ta jest przestarzała i należy ją zastąpić przez opcje \&\fIverifyChain\fR i \fIverifyPeer\fR. .RS 4 .IP "\fIpoziom 0\fR" 4 .IX Item "poziom 0" zarządaj certyfikatu i zignoruj go .IP "\fIpoziom 1\fR" 4 .IX Item "poziom 1" weryfikuj, jeżeli został przedstawiony .IP "\fIpoziom 2\fR" 4 .IX Item "poziom 2" weryfikuj z zainstalowanym certyfikatem Centrum Certyfikacji .IP "\fIpoziom 3\fR" 4 .IX Item "poziom 3" weryfikuj z lokalnie zainstalowanym certyfikatem drugiej strony .IP "\fIpoziom 4\fR" 4 .IX Item "poziom 4" weryfikuj z certyfikatem drugiej strony ignorując łańcuch CA .IP \fIdomyślnie\fR 4 .IX Item "domyślnie" nie weryfikuj .RE .RS 4 .RE .IP "\fBverifyChain\fR = yes | no" 4 .IX Item "verifyChain = yes | no" weryfikuj łańcuch certyfikatów drugiej strony .Sp Do weryfikacji certyfikatu serwera kluczowe jest, aby wymagać również konkretnego certyfikatu przy pomocy \fIcheckHost\fR lub \fIcheckIP\fR. .Sp Samopodpisany certyfikat głównego CA należy umieścić albo w pliku podanym w opcji \fICAfile\fR, albo w katalogu podanym w opcji \fICApath\fR. .Sp domyślnie: no .IP "\fBverifyPeer\fR = yes | no" 4 .IX Item "verifyPeer = yes | no" weryfikuj certyfikat drugiej strony .Sp Certyfikat drugiej strony należy umieścić albo w pliku podanym w opcji \&\fICAfile\fR, albo w katalogu podanym w opcji \fICApath\fR. .Sp domyślnie: no .SH "ZWRACANA WARTOŚĆ" .IX Header "ZWRACANA WARTOŚĆ" \&\fBstunnel\fR zwraca zero w przypadku sukcesu, lub wartość niezerową w przypadku błędu. .SH SIGNAŁY .IX Header "SIGNAŁY" Następujące sygnały mogą być użyte do sterowania programem w systemie Unix: .IP SIGHUP 4 .IX Item "SIGHUP" Załaduj ponownie plik konfiguracyjny. .Sp Niektóre globalne opcje nie będą przeładowane: .RS 4 .IP \(bu 4 chroot .IP \(bu 4 foreground .IP \(bu 4 pid .IP \(bu 4 setgid .IP \(bu 4 setuid .RE .RS 4 .Sp Jeżeli wykorzystywana jest opcja 'setuid' \fBstunnel\fR nie będzie mógł załadować ponownie konfiguracji wykorzystującej uprzywilejowane (<1024) porty. .Sp Jeżeli wykorzystywana jest opcja 'chroot' \fBstunnel\fR będzie szukał wszystkich potrzebnych plików (łącznie z plikiem konfiguracyjnym, certyfikatami, logiem i plikiem pid) wewnątrz katalogu wskazanego przez 'chroot'. .RE .IP SIGUSR1 4 .IX Item "SIGUSR1" Zamknij i otwórz ponownie log. Funkcja ta może zostać użyta w skrypcie rotującym log programu \fBstunnel\fR. .IP SIGUSR2 4 .IX Item "SIGUSR2" Zapisz w logu listę aktywnych połączeń. .IP "SIGTERM, SIGQUIT, SIGINT" 4 .IX Item "SIGTERM, SIGQUIT, SIGINT" Zakończ działanie programu. .PP Skutek wysłania innych sygnałów jest niezdefiniowany. .SH PRZYKŁADY .IX Header "PRZYKŁADY" Szyfrowanie połączeń do lokalnego serwera \fIimapd\fR można użyć: .PP .Vb 4 \& [imapd] \& accept = 993 \& exec = /usr/sbin/imapd \& execArgs = imapd .Ve .PP albo w trybie zdalnym: .PP .Vb 3 \& [imapd] \& accept = 993 \& connect = 143 .Ve .PP Aby umożliwić lokalnemu klientowi poczty elektronicznej korzystanie z serwera \&\fIimapd\fR przez TLS należy skonfigurować pobieranie poczty z adresu localhost i portu 119, oraz użyć następującej konfiguracji: .PP .Vb 4 \& [imap] \& client = yes \& accept = 143 \& connect = serwer:993 .Ve .PP W połączeniu z programem \fIpppd\fR \fBstunnel\fR pozwala zestawić prosty VPN. Po stronie serwera nasłuchującego na porcie 2020 jego konfiguracja może wyglądać następująco: .PP .Vb 5 \& [vpn] \& accept = 2020 \& exec = /usr/sbin/pppd \& execArgs = pppd local \& pty = yes .Ve .PP Poniższy plik konfiguracyjny może być wykorzystany do uruchomienia programu \fBstunnel\fR w trybie \fIinetd\fR. Warto zauważyć, że w pliku konfiguracyjnym nie ma sekcji \fI[nazwa_usługi]\fR. .PP .Vb 2 \& exec = /usr/sbin/imapd \& execArgs = imapd .Ve .PP Aby skonfigurować VPN można użyć następującej konfiguracji klienta: .PP .Vb 6 \& [socks_client] \& client = yes \& accept = 127.0.0.1:1080 \& connect = vpn_server:9080 \& verifyPeer = yes \& CAfile = stunnel.pem .Ve .PP Odpowiadająca jej konfiguracja serwera vpn_server: .PP .Vb 5 \& [socks_server] \& protocol = socks \& accept = 9080 \& cert = stunnel.pem \& key = stunnel.key .Ve .PP Do przetestowania konfiguracji można wydać na maszynie klienckiej komendę: .PP .Vb 1 \& curl \-\-socks4a localhost http://www.example.com/ .Ve .PP Przykładowa konfiguracja serwera SNI: .PP .Vb 5 \& [virtual] \& ; usługa nadrzędna \& accept = 443 \& cert = default.pem \& connect = default.internal.mydomain.com:8080 \& \& [sni1] \& ; usługa podrzędna 1 \& sni = virtual:server1.mydomain.com \& cert = server1.pem \& connect = server1.internal.mydomain.com:8081 \& \& [sni2] \& ; usługa podrzędna 2 \& sni = virtual:server2.mydomain.com \& cert = server2.pem \& connect = server2.internal.mydomain.com:8082 \& verifyPeer = yes \& CAfile = server2\-allowed\-clients.pem .Ve .PP Przykładowa konfiguracja umożliwiająca uwierzytelnienie z użyciem klucza prywatnego przechowywanego w Windows Certificate Store (tylko Windows): .PP .Vb 1 \& engine = capi \& \& [service] \& engineId = capi \& client = yes \& accept = 127.0.0.1:8080 \& connect = example.com:8443 .Ve .PP W przypadku użycia silnika CAPI, nie należy ustawiać opcji cert, gdyż klucz klienta zostanie automatycznie pobrany z Certificate Store na podstawie zaufanych certyfikatów CA przedstawionych przez serwer. .PP Przykładowa konfiguracja umożliwiająca użycie certyfikatu i klucza prywatnego z urządzenia obsługiwanego przez silnik pkcs11: .PP .Vb 3 \& engine = pkcs11 \& engineCtrl = MODULE_PATH:opensc\-pkcs11.so \& engineCtrl = PIN:123456 \& \& [service] \& engineId = pkcs11 \& client = yes \& accept = 127.0.0.1:8080 \& connect = example.com:843 \& cert = pkcs11:token=MyToken;object=MyCert \& key = pkcs11:token=MyToken;object=MyKey .Ve .PP Przykładowa konfiguracja umożliwiająca użycie certyfikatu i klucza prywatnego umieszczonego na tokenie SoftHSM: .PP .Vb 3 \& engine = pkcs11 \& engineCtrl = MODULE_PATH:softhsm2.dll \& engineCtrl = PIN:12345 \& \& [service] \& engineId = pkcs11 \& client = yes \& accept = 127.0.0.1:8080 \& connect = example.com:843 \& cert = pkcs11:token=MyToken;object=KeyCert .Ve .SH NOTKI .IX Header "NOTKI" .SS OGRANICZENIA .IX Subsection "OGRANICZENIA" \&\fBstunnel\fR nie może być używany do szyfrowania protokołu \fIFTP\fR, ponieważ do przesyłania poszczególnych plików używa on dodatkowych połączeń otwieranych na portach o dynamicznie przydzielanych numerach. Istnieją jednak specjalne wersje klientów i serwerów FTP pozwalające na szyfrowanie przesyłanych danych przy pomocy protokołu \fITLS\fR. .SS "TRYB INETD (tylko Unix)" .IX Subsection "TRYB INETD (tylko Unix)" W większości zastosowań \fBstunnel\fR samodzielnie nasłuchuje na porcie podanym w pliku konfiguracyjnym i tworzy połączenie z innym portem podanym w opcji \fIconnect\fR lub nowym programem podanym w opcji \fIexec\fR. Niektórzy wolą jednak wykorzystywać oddzielny program, który odbiera połączenia, po czym uruchamia program \fBstunnel\fR. Przykładami takich programów są inetd, xinetd i tcpserver. .PP Przykładowa linia pliku /etc/inetd.conf może wyglądać tak: .PP .Vb 2 \& imaps stream tcp nowait root @bindir@/stunnel \& stunnel @sysconfdir@/stunnel/imaps.conf .Ve .PP Ponieważ w takich przypadkach połączenie na zdefiniowanym porcie (tutaj \fIimaps\fR) nawiązuje osobny program (tutaj \fIinetd\fR), \fBstunnel\fR nie może używać opcji \fIaccept\fR. W pliku konfiguracyjnym nie może być również zdefiniowana żadna usługa (\fI[nazwa_usługi]\fR), ponieważ konfiguracja taka pozwala na nawiązanie tylko jednego połączenia. Wszystkie \fIOPCJE USŁUG\fR powinny być umieszczone razem z opcjami globalnymi. Przykład takiej konfiguracji znajduje się w sekcji \&\fIPRZYKŁADY\fR. .SS CERTYFIKATY .IX Subsection "CERTYFIKATY" Protokół TLS wymaga, aby każdy serwer przedstawiał się nawiązującemu połączenie klientowi prawidłowym certyfikatem X.509. Potwierdzenie tożsamości serwera polega na wykazaniu, że posiada on odpowiadający certyfikatowi klucz prywatny. Najprostszą metodą uzyskania certyfikatu jest wygenerowanie go przy pomocy wolnego pakietu \fBOpenSSL\fR. Więcej informacji na temat generowania certyfikatów można znaleźć na umieszczonych poniżej stronach. .PP Plik \fI.pem\fR powinien zawierać klucz prywatny oraz podpisany certyfikat (nie żądanie certyfikatu). Otrzymany plik powinien mieć następującą postać: .PP .Vb 6 \& \-\-\-\-\-BEGIN RSA PRIVATE KEY\-\-\-\-\- \& [zakodowany klucz] \& \-\-\-\-\-END RSA PRIVATE KEY\-\-\-\-\- \& \-\-\-\-\-BEGIN CERTIFICATE\-\-\-\-\- \& [zakodowany certyfikat] \& \-\-\-\-\-END CERTIFICATE\-\-\-\-\- .Ve .SS LOSOWOŚĆ .IX Subsection "LOSOWOŚĆ" \&\fBstunnel\fR potrzebuje zainicjować PRNG (generator liczb pseudolosowych), gdyż protokół TLS wymaga do bezpieczeństwa kryptograficznego źródła dobrej losowości. Następujące źródła są kolejno odczytywane aż do uzyskania wystarczającej ilości entropii: .IP \(bu 4 Zawartość pliku podanego w opcji \fIRNDfile\fR. .IP \(bu 4 Zawartość pliku o nazwie określonej przez zmienną środowiskową RANDFILE, o ile jest ona ustawiona. .IP \(bu 4 Plik .rnd umieszczony w katalogu domowym użytkownika, jeżeli zmienna RANDFILE nie jest ustawiona. .IP \(bu 4 Plik podany w opcji '\-\-with\-random' w czasie konfiguracji programu. .IP \(bu 4 Zawartość ekranu w systemie Windows. .IP \(bu 4 Gniazdo egd, jeżeli użyta została opcja \fIEGD\fR. .IP \(bu 4 Gniazdo egd podane w opcji '\-\-with\-egd\-socket' w czasie konfiguracji programu. .IP \(bu 4 Urządzenie /dev/urandom. .PP Warto zwrócić uwagę, że na maszynach z systemem Windows, na których konsoli nie pracuje użytkownik, zawartość ekranu nie jest wystarczająco zmienna, aby zainicjować PRNG. W takim przypadku do zainicjowania generatora należy użyć opcji \fIRNDfile\fR. .PP Plik \fIRNDfile\fR powinien zawierać dane losowe \-\- również w tym sensie, że powinny być one inne przy każdym uruchomieniu programu \fBstunnel\fR. O ile nie użyta została opcja \fIRNDoverwrite\fR jest to robione automatycznie. Do ręcznego uzyskania takiego pliku użyteczna może być komenda \fIopenssl rand\fR dostarczana ze współczesnymi wersjami pakietu \fBOpenSSL\fR. .PP Jeszcze jedna istotna informacja \-\- jeżeli dostępne jest urządzenie \&\fI/dev/urandom\fR biblioteka \fBOpenSSL\fR ma zwyczaj zasilania nim PRNG w trakcie sprawdzania stanu generatora. W systemach z \fI/dev/urandom\fR urządzenie to będzie najprawdopodobniej użyte, pomimo że znajduje się na samym końcu powyższej listy. Jest to właściwość biblioteki \fBOpenSSL\fR, a nie programu \&\fBstunnel\fR. .SS "PARAMETRY DH" .IX Subsection "PARAMETRY DH" Począwszy od wersji 4.40 \fBstunnel\fR zawiera w kodzie programu 2048\-bitowe parametry DH. Od wersji 5.18 te początkowe wartości parametrów DH są wymieniane na automatycznie generowane parametry tymczasowe. Wygenerowanie parametrów DH może zająć nawet wiele minut. .PP Alternatywnie parametry DH można umieścić w pliku razem z certyfikatem, co wyłącza generowanie parametrów tymczasowych: .PP .Vb 1 \& openssl dhparam 2048 >> stunnel.pem .Ve .SH PLIKI .IX Header "PLIKI" .ie n .IP \fR\fI@sysconfdir\fR\fI@/stunnel/stunnel.conf\fR 4 .el .IP \fR\f(CI@sysconfdir\fR\fI@/stunnel/stunnel.conf\fR 4 .IX Item "@sysconfdir@/stunnel/stunnel.conf" plik konfiguracyjny programu .SH BŁĘDY .IX Header "BŁĘDY" Opcja \fIexecArgs\fR oraz linia komend Win32 nie obsługuje cytowania. .SH "ZOBACZ RÓWNIEŻ" .IX Header "ZOBACZ RÓWNIEŻ" .IP \fBtcpd\fR\|(8) 4 .IX Item "tcpd" biblioteka kontroli dostępu do usług internetowych .IP \fBinetd\fR\|(8) 4 .IX Item "inetd" \&'super\-serwer' internetowy .IP \fIhttp://www.stunnel.org/\fR 4 .IX Item "http://www.stunnel.org/" strona domowa programu \fBstunnel\fR .IP \fIhttp://www.openssl.org/\fR 4 .IX Item "http://www.openssl.org/" strona projektu \fBOpenSSL\fR .SH AUTOR .IX Header "AUTOR" .IP "Michał Trojnara" 4 .IX Item "Michał Trojnara" <\fIMichal.Trojnara@stunnel.org\fR> stunnel-5.74/doc/stunnel.html.in0000644000175000001440000016724114701524325012364 stunnel TLS Proxy
 stunnel TLS Proxy

NAME

stunnel - TLS offloading and load-balancing proxy

SYNOPSIS

Unix:

stunnel [FILE] | -fd N | -help | -version | -sockets | -options

WIN32:

stunnel [ [ -install | -uninstall | -start | -stop | -reload | -reopen | -exit ] [-quiet] [FILE] ] | -help | -version | -sockets | -options

DESCRIPTION

The stunnel program is designed to work as TLS encryption wrapper between remote clients and local (inetd-startable) or remote servers. The concept is that having non-TLS aware daemons running on your system you can easily set them up to communicate with clients over secure TLS channels.

stunnel can be used to add TLS functionality to commonly used Inetd daemons like POP-2, POP-3, and IMAP servers, to standalone daemons like NNTP, SMTP and HTTP, and in tunneling PPP over network sockets without changes to the source code.

This product includes cryptographic software written by Eric Young (eay@cryptsoft.com)

OPTIONS

FILE

Use specified configuration file

-fd N (Unix only)

Read the config file from specified file descriptor

-help

Print stunnel help menu

-version

Print stunnel version and compile time defaults

-sockets

Print default socket options

-options

Print supported TLS options

-install (Windows NT and later only)

Install NT Service

-uninstall (Windows NT and later only)

Uninstall NT Service

-start (Windows NT and later only)

Start NT Service

-stop (Windows NT and later only)

Stop NT Service

-reload (Windows NT and later only)

Reload the configuration file of the running NT Service

-reopen (Windows NT and later only)

Reopen the log file of the running NT Service

-exit (Win32 only)

Exit an already started stunnel

-quiet (Win32 only)

Don't display any message boxes

CONFIGURATION FILE

Each line of the configuration file can be either:

  • An empty line (ignored).

  • A comment starting with ';' (ignored).

  • An 'option_name = option_value' pair.

  • '[service_name]' indicating a start of a service definition.

An address parameter of an option may be either:

  • A port number.

  • A colon-separated pair of IP address (either IPv4, IPv6, or domain name) and port number.

  • A Unix socket path (Unix only).

GLOBAL OPTIONS

chroot = DIRECTORY (Unix only)

directory to chroot stunnel process

chroot keeps stunnel in a chrooted jail. CApath, CRLpath, pid and exec are located inside the jail and the patches have to be relative to the directory specified with chroot.

Several functions of the operating system also need their files to be located within the chroot jail, e.g.:

  • Delayed resolver typically needs /etc/nsswitch.conf and /etc/resolv.conf.

  • Local time in log files needs /etc/timezone.

  • Some other functions may need devices, e.g. /dev/zero or /dev/null.

compression = deflate | zlib

select data compression algorithm

default: no compression

Deflate is the standard compression method as described in RFC 1951.

debug = [FACILITY.]LEVEL

debugging level

Level is one of the syslog level names or numbers emerg (0), alert (1), crit (2), err (3), warning (4), notice (5), info (6), or debug (7). All logs for the specified level and all levels numerically less than it will be shown.

The debug = debug (or the equivalent <debug = 7>) level produces for the most verbose log output. This logging level is only meant to be understood by stunnel developers, and not by users. Please either use the debug level when requested to do so by an stunnel developer, or when you intend to get confused.

The default logging level is notice (5).

The syslog 'daemon' facility will be used unless a facility name is supplied. (Facilities are not supported on Win32.)

Case is ignored for both facilities and levels.

EGD = EGD_PATH (Unix only)

path to Entropy Gathering Daemon socket

Entropy Gathering Daemon socket to use to feed the OpenSSL random number generator.

engine = auto | ENGINE_ID

select hardware or software cryptographic engine

default: software-only cryptography

See Examples section for an engine configuration to use the certificate and the corresponding private key from a cryptographic device.

engineCtrl = COMMAND[:PARAMETER]

control hardware engine

engineDefault = TASK_LIST

set OpenSSL tasks delegated to the current engine

The parameter specifies a comma-separated list of task to be delegated to the current engine.

The following tasks may be available, if supported by the engine: ALL, RSA, DSA, ECDH, ECDSA, DH, RAND, CIPHERS, DIGESTS, PKEY, PKEY_CRYPTO, PKEY_ASN1.

fips = yes | no

enable or disable FIPS 140-2 mode.

This option allows you to disable entering FIPS mode if stunnel was compiled with FIPS 140-2 support.

default: no (since version 5.00)

foreground = yes | quiet | no (Unix only)

foreground mode

Stay in foreground (don't fork).

With the yes parameter it also logs to stderr in addition to the destinations specified with syslog and output.

default: background in daemon mode

iconActive = ICON_FILE (GUI only)

GUI icon to be displayed when there are established connections

On Windows platform the parameter should be an .ico file containing a 16x16 pixel image.

iconError = ICON_FILE (GUI only)

GUI icon to be displayed when no valid configuration is loaded

On Windows platform the parameter should be an .ico file containing a 16x16 pixel image.

iconIdle = ICON_FILE (GUI only)

GUI icon to be displayed when there are no established connections

On Windows platform the parameter should be an .ico file containing a 16x16 pixel image.

log = append | overwrite

log file handling

This option allows you to choose whether the log file (specified with the output option) is appended or overwritten when opened or re-opened.

default: append

output = FILE

append log messages to a file

/dev/stdout device can be used to send log messages to the standard output (for example to log them with daemontools splogger).

pid = FILE (Unix only)

pid file location

If the argument is empty, then no pid file will be created.

pid path is relative to the chroot directory if specified.

RNDbytes = BYTES

bytes to read from random seed files

RNDfile = FILE

path to file with random seed data

The OpenSSL library will use data from this file first to seed the random number generator.

RNDoverwrite = yes | no

overwrite the random seed files with new random data

default: yes

service = SERVICE (Unix only)

stunnel service name

The specified service name is used for syslog and as the inetd mode service name for TCP Wrappers. While this option can technically be specified in the service sections, it is only useful in global options.

default: stunnel

syslog = yes | no (Unix only)

enable logging via syslog

default: yes

taskbar = yes | no (WIN32 only)

enable the taskbar icon

default: yes

SERVICE-LEVEL OPTIONS

Each configuration section begins with a service name in square brackets. The service name is used for libwrap (TCP Wrappers) access control and lets you distinguish stunnel services in your log files.

Note that if you wish to run stunnel in inetd mode (where it is provided a network socket by a server such as inetd, xinetd, or tcpserver) then you should read the section entitled INETD MODE below.

accept = [HOST:]PORT

accept connections on specified address

If no host specified, defaults to all IPv4 addresses for the local host.

To listen on all IPv6 addresses use:

accept = :::PORT
CAengine = ENGINE-SPECIFIC_CA_CERTIFICATE_IDENTIFIER

load a trusted CA certificate from an engine

The loaded CA certificates will be used with the verifyChain and verifyPeer options.

Multiple CAengine options are allowed in a single service section.

Currently supported engines: pkcs11, cng.

CApath = CA_DIRECTORY

load trusted CA certificates from a directory

The loaded CA certificates will be used with the verifyChain and verifyPeer options. Note that the certificates in this directory should be named XXXXXXXX.0 where XXXXXXXX is the hash value of the DER encoded subject of the cert.

This parameter can also be used to provide the root CA certificate needed to validate OCSP stapling in server mode.

The hash algorithm has been changed in OpenSSL 1.0.0. It is required to c_rehash the directory on upgrade from OpenSSL 0.x.x to OpenSSL 1.x.x or later.

CApath path is relative to the chroot directory if specified.

CAfile = CA_FILE

load trusted CA certificates from a file

The loaded CA certificates will be used with the verifyChain and verifyPeer options.

This parameter can also be used to provide the root CA certificate needed to validate OCSP stapling in server mode.

cert = CERT_FILE

certificate chain file name

The parameter specifies the file containing certificates used by stunnel to authenticate itself against the remote client or server. The file should contain the whole certificate chain starting from the actual server/client certificate, and ending with the self-signed root CA certificate. The file must be either in PEM or P12 format.

A certificate chain is required in server mode, and optional in client mode.

This parameter is also used as the certificate identifier when a hardware engine is enabled.

checkEmail = EMAIL

verify the email address of the end-entity (leaf) peer certificate subject

Certificates are accepted if no subject checks were specified, or the email address of the end-entity (leaf) peer certificate matches any of the email addresses specified with checkEmail.

Multiple checkEmail options are allowed in a single service section.

This option requires OpenSSL 1.0.2 or later.

checkHost = HOST

verify the host of the end-entity (leaf) peer certificate subject

Certificates are accepted if no subject checks were specified, or the host name of the end-entity (leaf) peer certificate matches any of the hosts specified with checkHost.

Multiple checkHost options are allowed in a single service section.

This option requires OpenSSL 1.0.2 or later.

checkIP = IP

verify the IP address of the end-entity (leaf) peer certificate subject

Certificates are accepted if no subject checks were specified, or the IP address of the end-entity (leaf) peer certificate matches any of the IP addresses specified with checkIP.

Multiple checkIP options are allowed in a single service section.

This option requires OpenSSL 1.0.2 or later.

ciphers = CIPHER_LIST

select permitted TLS ciphers (TLSv1.2 and below)

This option does not impact TLSv1.3 ciphersuites.

A colon-delimited list of the ciphers to allow in the TLS connection, for example DES-CBC3-SHA:IDEA-CBC-MD5.

ciphersuites = CIPHERSUITES_LIST

select permitted TLSv1.3 ciphersuites

A colon-delimited list of TLSv1.3 ciphersuites names in order of preference.

The ciphersuites option ignores unknown ciphers when compiled with OpenSSL 3.0 or later.

This option requires OpenSSL 1.1.1 or later.

default: TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256

client = yes | no

client mode (remote service uses TLS)

default: no (server mode)

config = COMMAND[:PARAMETER]

OpenSSL configuration command

The OpenSSL configuration command is executed with the specified parameter. This allows any configuration commands to be invoked from the stunnel configuration file. Supported commands are described on the SSL_CONF_cmd(3ssl) manual page.

Several config lines can be used to specify multiple configuration commands.

Use curves option instead of enabling config = Curves:list_curves to support elliptic curves.

This option requires OpenSSL 1.0.2 or later.

connect = [HOST:]PORT

connect to a remote address

If no host is specified, the host defaults to localhost.

Multiple connect options are allowed in a single service section. If host resolves to multiple addresses and/or if multiple connect options are specified, then the remote address is chosen using a round-robin algorithm.

CRLpath = DIRECTORY

Certificate Revocation Lists directory

This is the directory in which stunnel will look for CRLs when using the verifyChain and verifyPeer options. Note that the CRLs in this directory should be named XXXXXXXX.r0 where XXXXXXXX is the hash value of the CRL.

The hash algorithm has been changed in OpenSSL 1.0.0. It is required to c_rehash the directory on upgrade from OpenSSL 0.x.x to OpenSSL 1.x.x.

CRLpath path is relative to the chroot directory if specified.

CRLfile = CRL_FILE

Certificate Revocation Lists file

This file contains multiple CRLs, used with the verifyChain and verifyPeer options.

curves = list

ECDH curves separated with ':'

Only a single curve name is allowed for OpenSSL older than 1.1.1.

To get a list of supported curves use:

openssl ecparam -list_curves

default:

X25519:P-256:X448:P-521:P-384 (OpenSSL 1.1.1 or later)

prime256v1 (OpenSSL older than 1.1.1)
logId = TYPE

connection identifier type

This identifier allows you to distinguish log entries generated for each of the connections.

Currently supported types:

sequential

The numeric sequential identifier is only unique within a single instance of stunnel, but very compact. It is most useful for manual log analysis.

unique

This alphanumeric identifier is globally unique, but longer than the sequential number. It is most useful for automated log analysis.

thread

The operating system thread identifier is neither unique (even within a single instance of stunnel) nor short. It is most useful for debugging software or configuration issues.

process

The operating system process identifier (PID) may be useful in the inetd mode.

default: sequential

debug = LEVEL

debugging level

Level is a one of the syslog level names or numbers emerg (0), alert (1), crit (2), err (3), warning (4), notice (5), info (6), or debug (7). All logs for the specified level and all levels numerically less than it will be shown. The default is notice (5).

While the debug = debug or debug = 7 level generates the most verbose output, it is only intended to be used by stunnel developers. Please only use this value if you are a developer, or you intend to send your logs to our technical support. Otherwise, the generated logs will be confusing.

delay = yes | no

delay DNS lookup for the connect option

This option is useful for dynamic DNS, or when DNS is not available during stunnel startup (road warrior VPN, dial-up configurations).

Delayed resolver mode is automatically engaged when stunnel fails to resolve on startup any of the connect targets for a service.

Delayed resolver inflicts failover = prio.

default: no

engineId = ENGINE_ID

select engine ID for the service

engineNum = ENGINE_NUMBER

select engine number for the service

The engines are numbered starting from 1.

exec = EXECUTABLE_PATH

execute a local inetd-type program

exec path is relative to the chroot directory if specified.

The following environmental variables are set on Unix platforms: REMOTE_HOST, REMOTE_PORT, SSL_CLIENT_DN, SSL_CLIENT_I_DN.

execArgs = $0 $1 $2 ...

arguments for exec including the program name ($0)

Quoting is currently not supported. Arguments are separated with an arbitrary amount of whitespace.

failover = rr | prio

Failover strategy for multiple "connect" targets.

rr

round robin - fair load distribution

prio

priority - use the order specified in config file

default: prio

ident = USERNAME

use IDENT (RFC 1413) username checking

include = DIRECTORY

include all configuration file parts located in DIRECTORY

The files are included in the ascending alphabetical order of their names. The recommended filename convention is

for global options:

00-global.conf

for local service-level options:

01-service.conf

02-service.conf
key = KEY_FILE

private key for the certificate specified with cert option

A private key is needed to authenticate the certificate owner. Since this file should be kept secret it should only be readable by its owner. On Unix systems you can use the following command:

chmod 600 keyfile

This parameter is also used as the private key identifier when a hardware engine is enabled.

default: the value of the cert option

libwrap = yes | no

Enable or disable the use of /etc/hosts.allow and /etc/hosts.deny.

default: no (since version 5.00)

local = HOST

By default, the IP address of the outgoing interface is used as the source for remote connections. Use this option to bind a static local IP address instead.

OCSP = URL

select OCSP responder for the end-entity (leaf) peer certificate verification

OCSPaia = yes | no

validate certificates with their AIA OCSP responders

This option enables stunnel to validate certificates with the list of OCSP responder URLs retrieved from their AIA (Authority Information Access) extension.

OCSPflag = OCSP_FLAG

specify OCSP responder flag

Several OCSPflag can be used to specify multiple flags.

currently supported flags: NOCERTS, NOINTERN, NOSIGS, NOCHAIN, NOVERIFY, NOEXPLICIT, NOCASIGN, NODELEGATED, NOCHECKS, TRUSTOTHER, RESPID_KEY, NOTIME

OCSPnonce = yes | no

send and verify the OCSP nonce extension

This option protects the OCSP protocol against replay attacks. Due to its computational overhead, the nonce extension is usually only supported on internal (e.g. corporate) responders, and not on public OCSP responders.

OCSPrequire = yes | no

require a conclusive OCSP response

Disable this option to allow a connection even though no conclusive OCSP response was retrieved from stapling and a direct request to the OCSP responder.

default: yes

options = SSL_OPTIONS

OpenSSL library options

The parameter is the OpenSSL option name as described in the SSL_CTX_set_options(3ssl) manual, but without SSL_OP_ prefix. stunnel -options lists the options found to be allowed in the current combination of stunnel and the OpenSSL library used to build it.

Several option lines can be used to specify multiple options. An option name can be prepended with a dash ("-") to disable the option.

For example, for compatibility with the erroneous Eudora TLS implementation, the following option can be used:

options = DONT_INSERT_EMPTY_FRAGMENTS

default:

options = NO_SSLv2
options = NO_SSLv3

Use sslVersionMax or sslVersionMin option instead of disabling specific TLS protocol versions when compiled with OpenSSL 1.1.0 or later.

protocol = PROTO

application protocol to negotiate TLS

This option enables initial, protocol-specific negotiation of the TLS encryption. The protocol option should not be used with TLS encryption on a separate port.

Currently supported protocols:

cifs

Proprietary (undocummented) extension of CIFS protocol implemented in Samba. Support for this extension was dropped in Samba 3.0.0.

capwin

http://www.capwin.org/ application support

capwinctrl

http://www.capwin.org/ application support

This protocol is only supported in client mode.

connect

Based on RFC 2817 - Upgrading to TLS Within HTTP/1.1, section 5.2 - Requesting a Tunnel with CONNECT

This protocol is only supported in client mode.

imap

Based on RFC 2595 - Using TLS with IMAP, POP3 and ACAP

ldap

Based on RFC 2830 - Lightweight Directory Access Protocol (v3): Extension for Transport Layer Security

nntp

Based on RFC 4642 - Using Transport Layer Security (TLS) with Network News Transfer Protocol (NNTP)

This protocol is only supported in client mode.

pgsql

Based on http://www.postgresql.org/docs/8.3/static/protocol-flow.html#AEN73982

pop3

Based on RFC 2449 - POP3 Extension Mechanism

proxy

Passing of the original client IP address with HAProxy PROXY protocol version 1 https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt

smtp

Based on RFC 2487 - SMTP Service Extension for Secure SMTP over TLS

socks

SOCKS versions 4, 4a, and 5 are supported. The SOCKS protocol itself is encapsulated within TLS encryption layer to protect the final destination address.

http://www.openssh.com/txt/socks4.protocol

http://www.openssh.com/txt/socks4a.protocol

The BIND command of the SOCKS protocol is not supported. The USERID parameter is ignored.

See Examples section for sample configuration files for VPN based on SOCKS encryption.

protocolAuthentication = AUTHENTICATION

authentication type for the protocol negotiations

Currently, this option is only supported in the client-side 'connect' and 'smtp' protocols.

Supported authentication types for the 'connect' protocol are 'basic' or 'ntlm'. The default 'connect' authentication type is 'basic'.

Supported authentication types for the 'smtp' protocol are 'plain' or 'login'. The default 'smtp' authentication type is 'plain'.

protocolDomain = DOMAIN

domain for the protocol negotiations

Currently, this option is only supported in the client-side 'connect' protocol.

protocolHeader = HEADER

header for the protocol negotiations

Currently, this option is only supported in the client-side 'connect' protocol.

protocolHost = ADDRESS

host address for the protocol negotiations

For the 'connect' protocol negotiations, protocolHost specifies HOST:PORT of the final TLS server to be connected to by the proxy. The proxy server directly connected by stunnel must be specified with the connect option.

For the 'smtp' protocol negotiations, protocolHost controls the client SMTP HELO/EHLO value.

protocolPassword = PASSWORD

password for the protocol negotiations

Currently, this option is only supported in the client-side 'connect' and 'smtp' protocols.

protocolUsername = USERNAME

username for the protocol negotiations

Currently, this option is only supported in the client-side 'connect' and 'smtp' protocols.

PSKidentity = IDENTITY

PSK identity for the PSK client

PSKidentity can be used on stunnel clients to select the PSK identity used for authentication. This option is ignored in server sections.

default: the first identity specified in the PSKsecrets file.

PSKsecrets = FILE

file with PSK identities and corresponding keys

Each line of the file in the following format:

IDENTITY:KEY

Hexadecimal keys are automatically converted to binary form. Keys are required to be at least 16 bytes long, which implies at least 32 characters for hexadecimal keys. The file should neither be world-readable nor world-writable.

pty = yes | no (Unix only)

allocate a pseudoterminal for 'exec' option

redirect = [HOST:]PORT

redirect TLS client connections on certificate-based authentication failures

This option only works in server mode. Some protocol negotiations are also incompatible with the redirect option.

renegotiation = yes | no

support TLS renegotiation

Applications of the TLS renegotiation include some authentication scenarios, or re-keying long lasting connections.

On the other hand this feature can facilitate a trivial CPU-exhaustion DoS attack:

http://vincent.bernat.im/en/blog/2011-ssl-dos-mitigation.html

Please note that disabling TLS renegotiation does not fully mitigate this issue.

default: yes (if supported by OpenSSL)

reset = yes | no

attempt to use the TCP RST flag to indicate an error

This option is not supported on some platforms.

default: yes

retry = yes | no | DELAY

reconnect a connect+exec section after it was disconnected

The DELAY value specifies the number of milliseconds before retrying. "retry = yes" has the same effect as "retry = 1000".

default: no

securityLevel = LEVEL

set the security level

The meaning of each level is described below:

level 0

Everything is permitted.

level 1

The security level corresponds to a minimum of 80 bits of security. Any parameters offering below 80 bits of security are excluded. As a result RSA, DSA and DH keys shorter than 1024 bits and ECC keys shorter than 160 bits are prohibited. All export cipher suites are prohibited since they all offer less than 80 bits of security. SSL version 2 is prohibited. Any cipher suite using MD5 for the MAC is also prohibited. Additionally, SSLv3, TLS 1.0, TLS 1.1 are all disabled for OpenSSL 3.0 and later.

level 2

Security level set to 112 bits of security. As a result RSA, DSA and DH keys shorter than 2048 bits and ECC keys shorter than 224 bits are prohibited. In addition to the level 1 exclusions any cipher suite using RC4 is also prohibited. Compression is disabled. SSL version 3 is also not allowed for OpenSSL older than 3.0.

level 3

Security level set to 128 bits of security. As a result RSA, DSA and DH keys shorter than 3072 bits and ECC keys shorter than 256 bits are prohibited. In addition to the level 2 exclusions cipher suites not offering forward secrecy are prohibited. Session tickets are disabled. TLS versions below 1.1 are not permitted for OpenSSL older than 3.0.

level 4

Security level set to 192 bits of security. As a result RSA, DSA and DH keys shorter than 7680 bits and ECC keys shorter than 384 bits are prohibited. Cipher suites using SHA1 for the MAC are prohibited. TLS versions below 1.2 are not permitted for OpenSSL older than 3.0.

level 5

Security level set to 256 bits of security. As a result RSA, DSA and DH keys shorter than 15360 bits and ECC keys shorter than 512 bits are prohibited.

default: 2

The securityLevel option is only available when compiled with OpenSSL 1.1.0 and later.

requireCert = yes | no

require a client certificate for verifyChain or verifyPeer

With requireCert set to no, the stunnel server accepts client connections that did not present a certificate.

Both verifyChain = yes and verifyPeer = yes imply requireCert = yes.

default: no

setgid = GROUP (Unix only)

Unix group id

As a global option: setgid() to the specified group in daemon mode and clear all other groups.

As a service-level option: set the group of the Unix socket specified with "accept".

setuid = USER (Unix only)

Unix user id

As a global option: setuid() to the specified user in daemon mode.

As a service-level option: set the owner of the Unix socket specified with "accept".

sessionCacheSize = NUM_ENTRIES

session cache size

sessionCacheSize specifies the maximum number of the internal session cache entries.

The value of 0 can be used for unlimited size. It is not recommended for production use due to the risk of a memory exhaustion DoS attack.

sessionCacheTimeout = TIMEOUT

session cache timeout

This is the number of seconds to keep cached TLS sessions.

sessionResume = yes | no

allow or disallow session resumption

default: yes

sessiond = HOST:PORT

address of sessiond TLS cache server

sni = SERVICE_NAME:SERVER_NAME_PATTERN (server mode)

Use the service as a secondary service (a name-based virtual server) for Server Name Indication TLS extension (RFC 3546).

SERVICE_NAME specifies the primary service that accepts client connections with the accept option. SERVER_NAME_PATTERN specifies the host name to be redirected. The pattern may start with the '*' character, e.g. '*.example.com'. Multiple secondary services are normally specified for a single primary service. The sni option can also be specified more than once within a single secondary service.

This service, as well as the primary service, may not be configured in client mode.

The connect option of the secondary service is ignored when the protocol option is specified, as protocol connects to the remote host before TLS handshake.

Libwrap checks (Unix only) are performed twice: with the primary service name after TCP connection is accepted, and with the secondary service name during the TLS handshake.

The sni option is only available when compiled with OpenSSL 1.0.0 and later.

sni = SERVER_NAME (client mode)

Use the parameter as the value of TLS Server Name Indication (RFC 3546) extension.

Empty SERVER_NAME disables sending the SNI extension.

The sni option is only available when compiled with OpenSSL 1.0.0 and later.

socket = a|l|r:OPTION=VALUE[:VALUE]

Set an option on the accept/local/remote socket

The values for the linger option are l_onof:l_linger. The values for the time are tv_sec:tv_usec.

Examples:

socket = l:SO_LINGER=1:60
    set one minute timeout for closing local socket
socket = r:SO_OOBINLINE=yes
    place out-of-band data directly into the
    receive data stream for remote sockets
socket = a:SO_REUSEADDR=no
    disable address reuse (enabled by default)
socket = a:SO_BINDTODEVICE=lo
    only accept connections on loopback interface
sslVersion = SSL_VERSION

select the TLS protocol version

Supported versions: all, SSLv2, SSLv3, TLSv1, TLSv1.1, TLSv1.2, TLSv1.3

Availability of specific protocols depends on the linked OpenSSL library. Older versions of OpenSSL do not support TLSv1.1, TLSv1.2 and TLSv1.3. Newer versions of OpenSSL do not support SSLv2.

Obsolete SSLv2 and SSLv3 are currently disabled by default.

Setting the option

sslVersion = SSL_VERSION

is equivalent to options

sslVersionMax = SSL_VERSION
sslVersionMin = SSL_VERSION

when compiled with OpenSSL 1.1.0 and later.

sslVersionMax = SSL_VERSION

maximum supported protocol versions

Supported versions: all, SSLv3, TLSv1, TLSv1.1, TLSv1.2, TLSv1.3

all enable protocol versions up to the highest version supported by the linked OpenSSL library.

Availability of specific protocols depends on the linked OpenSSL library.

The sslVersionMax option is only available when compiled with OpenSSL 1.1.0 and later.

default: all

sslVersionMin = SSL_VERSION

minimum supported protocol versions

Supported versions: all, SSLv3, TLSv1, TLSv1.1, TLSv1.2, TLSv1.3

all enable protocol versions down to the lowest version supported by the linked OpenSSL library.

Availability of specific protocols depends on the linked OpenSSL library.

The sslVersionMin option is only available when compiled with OpenSSL 1.1.0 and later.

default: TLSv1

stack = BYTES (except for FORK model)

CPU stack size of created threads

Excessive thread stack size increases virtual memory usage. Insufficient thread stack size may cause application crashes.

default: 65536 bytes (sufficient for all platforms we tested)

ticketKeySecret = SECRET

hexadecimal symmetric key used for session ticket confidentiality protection

Session tickets defined in RFC 5077 provide an enhanced session resumption capability, where the server-side caching is not required to maintain per session state.

Combining ticketKeySecret and ticketMacSecret options allow to resume a negotiated session on other cluster nodes, or to resume a negotiated session after server restart.

The key is required to be either 16 or 32 bytes long, which implies exactly 32 or 64 hexadecimal digits. Colons may optionally be used between two-character hexadecimal bytes.

This option only works in server mode.

The ticketKeySecret option is only available when compiled with OpenSSL 1.0.0 and later.

Disabling NO_TICKET option is required for the ticket support in OpenSSL older than 1.1.1, but note that this option is incompatible with the redirect option.

ticketMacSecret = SECRET

hexadecimal symmetric key used for session ticket integrity protection

The key is required to be either 16 or 32 bytes long, which implies exactly 32 or 64 hexadecimal digits. Colons may optionally be used between two-character hexadecimal bytes.

This option only works in server mode.

The ticketMacSecret option is only available when compiled with OpenSSL 1.0.0 and later.

TIMEOUTbusy = SECONDS

time to wait for expected data

TIMEOUTclose = SECONDS

time to wait for close_notify (set to 0 for buggy MSIE)

TIMEOUTconnect = SECONDS

time to wait to connect a remote host

TIMEOUTidle = SECONDS

time to keep an idle connection

TIMEOUTocsp = SECONDS

time to wait to connect an OCSP responder

transparent = none | source | destination | both (Unix only)

enable transparent proxy support on selected platforms

Supported values:

none

Disable transparent proxy support. This is the default.

source

Re-write the address to appear as if a wrapped daemon is connecting from the TLS client machine instead of the machine running stunnel.

This option is currently available in:

Remote mode (connect option) on Linux >=2.6.28

This configuration requires stunnel to be executed as root and without the setuid option.

This configuration requires the following setup for iptables and routing (possibly in /etc/rc.local or equivalent file):

iptables -t mangle -N DIVERT
iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
iptables -t mangle -A DIVERT -j MARK --set-mark 1
iptables -t mangle -A DIVERT -j ACCEPT
ip rule add fwmark 1 lookup 100
ip route add local 0.0.0.0/0 dev lo table 100
echo 0 >/proc/sys/net/ipv4/conf/lo/rp_filter

stunnel must also to be executed as root and without the setuid option.

Remote mode (connect option) on Linux 2.2.x

This configuration requires the kernel to be compiled with the transparent proxy option. Connected service must be installed on a separate host. Routing towards the clients has to go through the stunnel box.

stunnel must also to be executed as root and without the setuid option.

Remote mode (connect option) on FreeBSD >=8.0

This configuration requires additional firewall and routing setup. stunnel must also to be executed as root and without the setuid option.

Local mode (exec option)

This configuration works by pre-loading the libstunnel.so shared library. _RLD_LIST environment variable is used on Tru64, and LD_PRELOAD variable on other platforms.

destination

The original destination is used instead of the connect option.

A service section for transparent destination may look like this:

[transparent]
client = yes
accept = <stunnel_port>
transparent = destination

This configuration requires iptables setup to work, possibly in /etc/rc.local or equivalent file.

For a connect target installed on the same host:

/sbin/iptables -t nat -I OUTPUT -p tcp --dport <redirected_port> \
    -m ! --uid-owner <stunnel_user_id> \
    -j DNAT --to-destination <local_ip>:<stunnel_port>

For a connect target installed on a remote host:

/sbin/iptables -I INPUT -i eth0 -p tcp --dport <stunnel_port> -j ACCEPT
/sbin/iptables -t nat -I PREROUTING -p tcp --dport <redirected_port> \
    -i eth0 -j DNAT --to-destination <local_ip>:<stunnel_port>

The transparent destination option is currently only supported on Linux.

both

Use both source and destination transparent proxy.

Two legacy options are also supported for backward compatibility:

yes

This option has been renamed to source.

no

This option has been renamed to none.

verify = LEVEL

verify the peer certificate

This option is obsolete and should be replaced with the verifyChain and verifyPeer options.

level 0

Request and ignore the peer certificate chain.

level 1

Verify the peer certificate chain if present.

level 2

Verify the peer certificate chain.

level 3

Verify the peer certificate chain and the end-entity (leaf) peer certificate against a locally installed certificate.

level 4

Ignore the peer certificate chain and only verify the end-entity (leaf) peer certificate against a locally installed certificate.

default

No verify.

verifyChain = yes | no

verify the peer certificate chain starting from the root CA

For server certificate verification it is essential to also require a specific certificate with checkHost or checkIP.

The self-signed root CA certificate needs to be stored either in the file specified with CAfile, or in the directory specified with CApath.

default: no

verifyPeer = yes | no

verify the end-entity (leaf) peer certificate

The end-entity (leaf) peer certificate needs to be stored either in the file specified with CAfile, or in the directory specified with CApath.

default: no

RETURN VALUE

stunnel returns zero on success, non-zero on error.

SIGNALS

The following signals can be used to control stunnel in Unix environment:

SIGHUP

Force a reload of the configuration file.

Some global options will not be reloaded:

  • chroot

  • foreground

  • pid

  • setgid

  • setuid

The use of the 'setuid' option will also prevent stunnel from binding to privileged (<1024) ports during configuration reloading.

When the 'chroot' option is used, stunnel will look for all its files (including the configuration file, certificates, the log file and the pid file) within the chroot jail.

SIGUSR1

Close and reopen the stunnel log file. This function can be used for log rotation.

SIGUSR2

Log the list of active connections.

SIGTERM, SIGQUIT, SIGINT

Shut stunnel down.

The result of sending any other signals to the server is undefined.

EXAMPLES

In order to provide TLS encapsulation to your local imapd service, use:

[imapd]
accept = 993
exec = /usr/sbin/imapd
execArgs = imapd

or in remote mode:

[imapd]
accept = 993
connect = 143

In order to let your local e-mail client connect to a TLS-enabled imapd service on another server, configure the e-mail client to connect to localhost on port 119 and use:

[imap]
client = yes
accept = 143
connect = servername:993

If you want to provide tunneling to your pppd daemon on port 2020, use something like:

[vpn]
accept = 2020
exec = /usr/sbin/pppd
execArgs = pppd local
pty = yes

If you want to use stunnel in inetd mode to launch your imapd process, you'd use this stunnel.conf. Note there must be no [service_name] section.

exec = /usr/sbin/imapd
execArgs = imapd

To setup SOCKS VPN configure the following client service:

[socks_client]
client = yes
accept = 127.0.0.1:1080
connect = vpn_server:9080
verifyPeer = yes
CAfile = stunnel.pem

The corresponding configuration on the vpn_server host:

[socks_server]
protocol = socks
accept = 9080
cert = stunnel.pem
key = stunnel.key

Now test your configuration on the client machine with:

curl --socks4a localhost http://www.example.com/

An example server mode SNI configuration:

[virtual]
; primary service
accept = 443
cert =  default.pem
connect = default.internal.mydomain.com:8080

[sni1]
; secondary service 1
sni = virtual:server1.mydomain.com
cert = server1.pem
connect = server1.internal.mydomain.com:8081

[sni2]
; secondary service 2
sni = virtual:server2.mydomain.com
cert = server2.pem
connect = server2.internal.mydomain.com:8082
verifyPeer = yes
CAfile = server2-allowed-clients.pem

An example of advanced engine configuration allows for authentication with private keys stored in the Windows certificate store (Windows only). With the CAPI engine you don't need to manually select the client key to use. The client key is automatically selected based on the list of CAs trusted by the server.

engine = capi

[service]
engineId = capi
client = yes
accept = 127.0.0.1:8080
connect = example.com:8443

An example of advanced engine configuration to use the certificate and the corresponding private key from a pkcs11 engine:

engine = pkcs11
engineCtrl = MODULE_PATH:opensc-pkcs11.so
engineCtrl = PIN:123456

[service]
engineId = pkcs11
client = yes
accept = 127.0.0.1:8080
connect = example.com:843
cert = pkcs11:token=MyToken;object=MyCert
key = pkcs11:token=MyToken;object=MyKey

An example of advanced engine configuration to use the certificate and the corresponding private key from a SoftHSM token:

engine = pkcs11
engineCtrl = MODULE_PATH:softhsm2.dll
engineCtrl = PIN:12345

[service]
engineId = pkcs11
client = yes
accept = 127.0.0.1:8080
connect = example.com:843
cert = pkcs11:token=MyToken;object=KeyCert

NOTES

RESTRICTIONS

stunnel cannot be used for the FTP daemon because of the nature of the FTP protocol which utilizes multiple ports for data transfers. There are available TLS-enabled versions of FTP and telnet daemons, however.

INETD MODE

The most common use of stunnel is to listen on a network port and establish communication with either a new port via the connect option, or a new program via the exec option. However there is a special case when you wish to have some other program accept incoming connections and launch stunnel, for example with inetd, xinetd, or tcpserver.

For example, if you have the following line in inetd.conf:

imaps stream tcp nowait root @bindir@/stunnel stunnel @sysconfdir@/stunnel/imaps.conf

In these cases, the inetd-style program is responsible for binding a network socket (imaps above) and handing it to stunnel when a connection is received. Thus you do not want stunnel to have any accept option. All the Service Level Options should be placed in the global options section, and no [service_name] section will be present. See the EXAMPLES section for example configurations.

CERTIFICATES

Each TLS-enabled daemon needs to present a valid X.509 certificate to the peer. It also needs a private key to decrypt the incoming data. The easiest way to obtain a certificate and a key is to generate them with the free OpenSSL package. You can find more information on certificates generation on pages listed below.

The .pem file should contain the unencrypted private key and a signed certificate (not certificate request). So the file should look like this:

-----BEGIN RSA PRIVATE KEY-----
[encoded key]
-----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE-----
[encoded certificate]
-----END CERTIFICATE-----

RANDOMNESS

stunnel needs to seed the PRNG (pseudo-random number generator) in order for TLS to use good randomness. The following sources are loaded in order until sufficient random data has been gathered:

  • The file specified with the RNDfile flag.

  • The file specified by the RANDFILE environment variable, if set.

  • The file .rnd in your home directory, if RANDFILE not set.

  • The file specified with '--with-random' at compile time.

  • The contents of the screen if running on Windows.

  • The egd socket specified with the EGD flag.

  • The egd socket specified with '--with-egd-sock' at compile time.

  • The /dev/urandom device.

Note that on Windows machines that do not have console user interaction (mouse movements, creating windows, etc.) the screen contents are not variable enough to be sufficient, and you should provide a random file for use with the RNDfile flag.

Note that the file specified with the RNDfile flag should contain random data -- that means it should contain different information each time stunnel is run. This is handled automatically unless the RNDoverwrite flag is used. If you wish to update this file manually, the openssl rand command in recent versions of OpenSSL, would be useful.

Important note: If /dev/urandom is available, OpenSSL often seeds the PRNG with it while checking the random state. On systems with /dev/urandom OpenSSL is likely to use it even though it is listed at the very bottom of the list above. This is the behaviour of OpenSSL and not stunnel.

DH PARAMETERS

stunnel 4.40 and later contains hardcoded 2048-bit DH parameters. Starting with stunnel 5.18, these hardcoded DH parameters are replaced every 24 hours with autogenerated temporary DH parameters. DH parameter generation may take several minutes.

Alternatively, it is possible to specify static DH parameters in the certificate file, which disables generating temporary DH parameters:

openssl dhparam 2048 >> stunnel.pem

FILES

@sysconfdir@/stunnel/stunnel.conf

stunnel configuration file

BUGS

The execArgs option and the Win32 command line do not support quoting.

SEE ALSO

tcpd(8)

access control facility for internet services

inetd(8)

internet 'super-server'

http://www.stunnel.org/

stunnel homepage

http://www.openssl.org/

OpenSSL project website

AUTHOR

Michał Trojnara

<Michal.Trojnara@stunnel.org>

 stunnel TLS Proxy
stunnel-5.74/doc/stunnel.pod.in0000644000175000001440000013274514701523115012177 =head1 NAME =encoding utf8 stunnel - TLS offloading and load-balancing proxy =head1 SYNOPSIS =over 4 =item B B [S] | S<-fd N> | S<-help> | S<-version> | S<-sockets> | S<-options> =item B B [ [ S<-install> | S<-uninstall> | S<-start> | S<-stop> | S<-reload> | S<-reopen> | S<-exit> ] [S<-quiet>] [S] ] | S<-help> | S<-version> | S<-sockets> | S<-options> =back =head1 DESCRIPTION The B program is designed to work as I encryption wrapper between remote clients and local (I-startable) or remote servers. The concept is that having non-TLS aware daemons running on your system you can easily set them up to communicate with clients over secure I channels. B can be used to add I functionality to commonly used I daemons like POP-2, POP-3, and IMAP servers, to standalone daemons like NNTP, SMTP and HTTP, and in tunneling PPP over network sockets without changes to the source code. This product includes cryptographic software written by Eric Young (eay@cryptsoft.com) =head1 OPTIONS =over 4 =item B Use specified configuration file =item B<-fd N> (Unix only) Read the config file from specified file descriptor =item B<-help> Print B help menu =item B<-version> Print B version and compile time defaults =item B<-sockets> Print default socket options =item B<-options> Print supported TLS options =item B<-install> (Windows NT and later only) Install NT Service =item B<-uninstall> (Windows NT and later only) Uninstall NT Service =item B<-start> (Windows NT and later only) Start NT Service =item B<-stop> (Windows NT and later only) Stop NT Service =item B<-reload> (Windows NT and later only) Reload the configuration file of the running NT Service =item B<-reopen> (Windows NT and later only) Reopen the log file of the running NT Service =item B<-exit> (Win32 only) Exit an already started stunnel =item B<-quiet> (Win32 only) Don't display any message boxes =back =head1 CONFIGURATION FILE Each line of the configuration file can be either: =over 4 =item * An empty line (ignored). =item * A comment starting with ';' (ignored). =item * An 'option_name = option_value' pair. =item * '[service_name]' indicating a start of a service definition. =back An address parameter of an option may be either: =over 4 =item * A port number. =item * A colon-separated pair of IP address (either IPv4, IPv6, or domain name) and port number. =item * A Unix socket path (Unix only). =back =head2 GLOBAL OPTIONS =over 4 =item B = DIRECTORY (Unix only) directory to chroot B process B keeps B in a chrooted jail. I, I, I and I are located inside the jail and the patches have to be relative to the directory specified with B. Several functions of the operating system also need their files to be located within the chroot jail, e.g.: =over 4 =item * Delayed resolver typically needs /etc/nsswitch.conf and /etc/resolv.conf. =item * Local time in log files needs /etc/timezone. =item * Some other functions may need devices, e.g. /dev/zero or /dev/null. =back =item B = deflate | zlib select data compression algorithm default: no compression Deflate is the standard compression method as described in RFC 1951. =item B = [FACILITY.]LEVEL debugging level Level is one of the syslog level names or numbers emerg (0), alert (1), crit (2), err (3), warning (4), notice (5), info (6), or debug (7). All logs for the specified level and all levels numerically less than it will be shown. The I (or the equivalent ) level produces for the most verbose log output. This logging level is only meant to be understood by stunnel developers, and not by users. Please either use the debug level when requested to do so by an stunnel developer, or when you intend to get confused. The default logging level is notice (5). The syslog 'daemon' facility will be used unless a facility name is supplied. (Facilities are not supported on Win32.) Case is ignored for both facilities and levels. =item B = EGD_PATH (Unix only) path to Entropy Gathering Daemon socket Entropy Gathering Daemon socket to use to feed the B random number generator. =item B = auto | ENGINE_ID select hardware or software cryptographic engine default: software-only cryptography See Examples section for an engine configuration to use the certificate and the corresponding private key from a cryptographic device. =item B = COMMAND[:PARAMETER] control hardware engine =item B = TASK_LIST set OpenSSL tasks delegated to the current engine The parameter specifies a comma-separated list of task to be delegated to the current engine. The following tasks may be available, if supported by the engine: ALL, RSA, DSA, ECDH, ECDSA, DH, RAND, CIPHERS, DIGESTS, PKEY, PKEY_CRYPTO, PKEY_ASN1. =item B = yes | no enable or disable FIPS 140-2 mode. This option allows you to disable entering FIPS mode if B was compiled with FIPS 140-2 support. default: no (since version 5.00) =item B = yes | quiet | no (Unix only) foreground mode Stay in foreground (don't fork). With the I parameter it also logs to stderr in addition to the destinations specified with I and I. default: background in daemon mode =item B = ICON_FILE (GUI only) GUI icon to be displayed when there are established connections On Windows platform the parameter should be an .ico file containing a 16x16 pixel image. =item B = ICON_FILE (GUI only) GUI icon to be displayed when no valid configuration is loaded On Windows platform the parameter should be an .ico file containing a 16x16 pixel image. =item B = ICON_FILE (GUI only) GUI icon to be displayed when there are no established connections On Windows platform the parameter should be an .ico file containing a 16x16 pixel image. =item B = append | overwrite log file handling This option allows you to choose whether the log file (specified with the I option) is appended or overwritten when opened or re-opened. default: append =item B = FILE append log messages to a file /dev/stdout device can be used to send log messages to the standard output (for example to log them with daemontools splogger). =item B = FILE (Unix only) pid file location If the argument is empty, then no pid file will be created. I path is relative to the I directory if specified. =item B = BYTES bytes to read from random seed files =item B = FILE path to file with random seed data The OpenSSL library will use data from this file first to seed the random number generator. =item B = yes | no overwrite the random seed files with new random data default: yes =item B = SERVICE (Unix only) stunnel service name The specified service name is used for syslog and as the I mode service name for TCP Wrappers. While this option can technically be specified in the service sections, it is only useful in global options. default: stunnel =item B = yes | no (Unix only) enable logging via syslog default: yes =item B = yes | no (WIN32 only) enable the taskbar icon default: yes =back =head2 SERVICE-LEVEL OPTIONS Each configuration section begins with a service name in square brackets. The service name is used for libwrap (TCP Wrappers) access control and lets you distinguish B services in your log files. Note that if you wish to run B in I mode (where it is provided a network socket by a server such as I, I, or I) then you should read the section entitled I below. =over 4 =item B = [HOST:]PORT accept connections on specified address If no host specified, defaults to all IPv4 addresses for the local host. To listen on all IPv6 addresses use: accept = :::PORT =item B = ENGINE-SPECIFIC_CA_CERTIFICATE_IDENTIFIER load a trusted CA certificate from an engine The loaded CA certificates will be used with the I and I options. Multiple I options are allowed in a single service section. Currently supported engines: pkcs11, cng. =item B = CA_DIRECTORY load trusted CA certificates from a directory The loaded CA certificates will be used with the I and I options. Note that the certificates in this directory should be named XXXXXXXX.0 where XXXXXXXX is the hash value of the DER encoded subject of the cert. This parameter can also be used to provide the root CA certificate needed to validate OCSP stapling in server mode. The hash algorithm has been changed in B. It is required to c_rehash the directory on upgrade from B to B or later. I path is relative to the I directory if specified. =item B = CA_FILE load trusted CA certificates from a file The loaded CA certificates will be used with the I and I options. This parameter can also be used to provide the root CA certificate needed to validate OCSP stapling in server mode. =item B = CERT_FILE certificate chain file name The parameter specifies the file containing certificates used by B to authenticate itself against the remote client or server. The file should contain the whole certificate chain starting from the actual server/client certificate, and ending with the self-signed root CA certificate. The file must be either in PEM or P12 format. A certificate chain is required in server mode, and optional in client mode. This parameter is also used as the certificate identifier when a hardware engine is enabled. =item B = EMAIL verify the email address of the end-entity (leaf) peer certificate subject Certificates are accepted if no subject checks were specified, or the email address of the end-entity (leaf) peer certificate matches any of the email addresses specified with I. Multiple I options are allowed in a single service section. This option requires OpenSSL 1.0.2 or later. =item B = HOST verify the host of the end-entity (leaf) peer certificate subject Certificates are accepted if no subject checks were specified, or the host name of the end-entity (leaf) peer certificate matches any of the hosts specified with I. Multiple I options are allowed in a single service section. This option requires OpenSSL 1.0.2 or later. =item B = IP verify the IP address of the end-entity (leaf) peer certificate subject Certificates are accepted if no subject checks were specified, or the IP address of the end-entity (leaf) peer certificate matches any of the IP addresses specified with I. Multiple I options are allowed in a single service section. This option requires OpenSSL 1.0.2 or later. =item B = CIPHER_LIST select permitted TLS ciphers (TLSv1.2 and below) This option does not impact TLSv1.3 ciphersuites. A colon-delimited list of the ciphers to allow in the TLS connection, for example DES-CBC3-SHA:IDEA-CBC-MD5. =item B = CIPHERSUITES_LIST select permitted TLSv1.3 ciphersuites A colon-delimited list of TLSv1.3 ciphersuites names in order of preference. The I option ignores unknown ciphers when compiled with B or later. This option requires OpenSSL 1.1.1 or later. default: TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256 =item B = yes | no client mode (remote service uses TLS) default: no (server mode) =item B = COMMAND[:PARAMETER] B configuration command The B configuration command is executed with the specified parameter. This allows any configuration commands to be invoked from the stunnel configuration file. Supported commands are described on the I manual page. Several I lines can be used to specify multiple configuration commands. Use I option instead of enabling I to support elliptic curves. This option requires OpenSSL 1.0.2 or later. =item B = [HOST:]PORT connect to a remote address If no host is specified, the host defaults to localhost. Multiple I options are allowed in a single service section. If host resolves to multiple addresses and/or if multiple I options are specified, then the remote address is chosen using a round-robin algorithm. =item B = DIRECTORY Certificate Revocation Lists directory This is the directory in which B will look for CRLs when using the I and I options. Note that the CRLs in this directory should be named XXXXXXXX.r0 where XXXXXXXX is the hash value of the CRL. The hash algorithm has been changed in B. It is required to c_rehash the directory on upgrade from B to B. I path is relative to the I directory if specified. =item B = CRL_FILE Certificate Revocation Lists file This file contains multiple CRLs, used with the I and I options. =item B = list ECDH curves separated with ':' Only a single curve name is allowed for OpenSSL older than 1.1.1. To get a list of supported curves use: openssl ecparam -list_curves default: X25519:P-256:X448:P-521:P-384 (OpenSSL 1.1.1 or later) prime256v1 (OpenSSL older than 1.1.1) =item B = TYPE connection identifier type This identifier allows you to distinguish log entries generated for each of the connections. Currently supported types: =over 4 =item I The numeric sequential identifier is only unique within a single instance of B, but very compact. It is most useful for manual log analysis. =item I This alphanumeric identifier is globally unique, but longer than the sequential number. It is most useful for automated log analysis. =item I The operating system thread identifier is neither unique (even within a single instance of B) nor short. It is most useful for debugging software or configuration issues. =item I The operating system process identifier (PID) may be useful in the inetd mode. =back default: sequential =item B = LEVEL debugging level Level is a one of the syslog level names or numbers emerg (0), alert (1), crit (2), err (3), warning (4), notice (5), info (6), or debug (7). All logs for the specified level and all levels numerically less than it will be shown. The default is notice (5). While the I or I level generates the most verbose output, it is only intended to be used by stunnel developers. Please only use this value if you are a developer, or you intend to send your logs to our technical support. Otherwise, the generated logs B be confusing. =item B = yes | no delay DNS lookup for the I option This option is useful for dynamic DNS, or when DNS is not available during B startup (road warrior VPN, dial-up configurations). Delayed resolver mode is automatically engaged when stunnel fails to resolve on startup any of the I targets for a service. Delayed resolver inflicts I. default: no =item B = ENGINE_ID select engine ID for the service =item B = ENGINE_NUMBER select engine number for the service The engines are numbered starting from 1. =item B = EXECUTABLE_PATH execute a local inetd-type program I path is relative to the I directory if specified. The following environmental variables are set on Unix platforms: REMOTE_HOST, REMOTE_PORT, SSL_CLIENT_DN, SSL_CLIENT_I_DN. =item B = $0 $1 $2 ... arguments for I including the program name ($0) Quoting is currently not supported. Arguments are separated with an arbitrary amount of whitespace. =item B = rr | prio Failover strategy for multiple "connect" targets. =over 4 =item I round robin - fair load distribution =item I priority - use the order specified in config file =back default: prio =item B = USERNAME use IDENT (RFC 1413) username checking =item B = DIRECTORY include all configuration file parts located in DIRECTORY The files are included in the ascending alphabetical order of their names. The recommended filename convention is for global options: 00-global.conf for local service-level options: 01-service.conf 02-service.conf =item B = KEY_FILE private key for the certificate specified with I option A private key is needed to authenticate the certificate owner. Since this file should be kept secret it should only be readable by its owner. On Unix systems you can use the following command: chmod 600 keyfile This parameter is also used as the private key identifier when a hardware engine is enabled. default: the value of the I option =item B = yes | no Enable or disable the use of /etc/hosts.allow and /etc/hosts.deny. default: no (since version 5.00) =item B = HOST By default, the IP address of the outgoing interface is used as the source for remote connections. Use this option to bind a static local IP address instead. =item B = URL select OCSP responder for the end-entity (leaf) peer certificate verification =item B = yes | no validate certificates with their AIA OCSP responders This option enables I to validate certificates with the list of OCSP responder URLs retrieved from their AIA (Authority Information Access) extension. =item B = OCSP_FLAG specify OCSP responder flag Several I can be used to specify multiple flags. currently supported flags: NOCERTS, NOINTERN, NOSIGS, NOCHAIN, NOVERIFY, NOEXPLICIT, NOCASIGN, NODELEGATED, NOCHECKS, TRUSTOTHER, RESPID_KEY, NOTIME =item B = yes | no send and verify the OCSP nonce extension This option protects the OCSP protocol against replay attacks. Due to its computational overhead, the nonce extension is usually only supported on internal (e.g. corporate) responders, and not on public OCSP responders. =item B = yes | no require a conclusive OCSP response Disable this option to allow a connection even though no conclusive OCSP response was retrieved from stapling and a direct request to the OCSP responder. default: yes =item B = SSL_OPTIONS B library options The parameter is the B option name as described in the I manual, but without I prefix. I lists the options found to be allowed in the current combination of I and the I library used to build it. Several I