-
-
Notifications
You must be signed in to change notification settings - Fork 158
📝 Document TLS options #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -143,6 +143,51 @@ <h2 id="-synopsis">🌻 Synopsis</h2> | |||||
|
|
||||||
| <p>All of the listed options are required, with the exception of <code>:title</code>, <code>:name_proc</code>, <code>:bind_dn</code>, and <code>:password</code>.</p> | ||||||
|
|
||||||
| <h2 id="tls-certificate-verification">TLS certificate verification</h2> | ||||||
|
|
||||||
| <p>This gem enables TLS certificate verification by default when you use <code>encryption: "ssl"</code> (LDAPS / simple TLS) or <code>encryption: "tls"</code> (STARTTLS). We always pass <code>tls_options</code> to Net::LDAP based on <code>OpenSSL::SSL::SSLContext::DEFAULT_PARAMS</code>, which includes <code>verify_mode: OpenSSL::SSL::VERIFY_PEER</code> and sane defaults.</p> | ||||||
|
|
||||||
| <ul> | ||||||
| <li>Secure by default: you do not need to set anything extra to verify the LDAP server certificate.</li> | ||||||
| <li>To customize trust or ciphers, supply your own <code>tls_options</code>, which are merged over the safe defaults.</li> | ||||||
| <li>If you truly need to skip verification (not recommended), set <code>disable_verify_certificates: true</code>.</li> | ||||||
| </ul> | ||||||
|
|
||||||
| <p>Examples:</p> | ||||||
|
|
||||||
| <pre class="code language-ruby"><code class="language-ruby"># Verify server certs (default behavior) | ||||||
| use OmniAuth::Strategies::LDAP, | ||||||
| host: ENV["LDAP_HOST"], | ||||||
| port: 636, | ||||||
| encryption: "ssl", # or "tls" | ||||||
| base: "dc=example,dc=com", | ||||||
| uid: "uid" | ||||||
|
|
||||||
| # Use a private CA bundle and restrict protocol/ciphers | ||||||
| use OmniAuth::Strategies::LDAP, | ||||||
| host: ENV["LDAP_HOST"], | ||||||
| port: 636, | ||||||
| encryption: "ssl", | ||||||
| base: "dc=example,dc=com", | ||||||
| uid: "uid", | ||||||
| tls_options: { | ||||||
| ca_file: "/etc/ssl/private/my_org_ca.pem", | ||||||
| ssl_version: "TLSv1_2", | ||||||
| ciphers: ["TLS_AES_256_GCM_SHA384", "TLS_CHACHA20_POLY1305_SHA256"], | ||||||
|
||||||
| ciphers: ["TLS_AES_256_GCM_SHA384", "TLS_CHACHA20_POLY1305_SHA256"], | |
| ciphers: "TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
ciphersoption in OpenSSL'stls_optionsexpects a colon-delimited string (e.g.,'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256'), not an array. The current example would likely cause an error when passed to OpenSSL. Consider updating the example to use the correct format:ciphers: 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256'