Home / OCI

OCIHow-toIntermediate

Hardening TLS on an OCI Load Balancer listener: disable TLS 1.0/1.1 and pick a cipher suite with the CLI

Fix a failed TLS scan on an OCI Load Balancer by choosing predefined or custom cipher suites and TLS protocols for HTTPS listeners with the CLI, without wiping other listener settings.

Deepak Bhardwaj7 min read

Applies toOCI Flexible Load Balancer (HTTPS/SSL listeners and backend sets), OCI CLI 3.x

Goal

A security scan flagged your OCI load balancer for accepting TLS 1.0 or 1.1, or for weak ciphers such as CBC or RC4 suites. You want the HTTPS listener to accept only TLS 1.2 and 1.3 with modern ciphers. You also want to make the change without breaking the certificate, rule sets or routing policy already on that listener.

On OCI Load Balancer, two listener settings control this:

  • protocols: the TLS versions the listener accepts, for example ["TLSv1.2","TLSv1.3"].
  • cipher-suite-name: a named list of ciphers. This can be an Oracle predefined suite or a custom suite you create on that load balancer.

The two must be compatible. If you enable TLS 1.3 with a suite that has no TLS 1.3 ciphers (or the reverse), handshakes fail.

Warning

oci lb listener update takes the full listener definition. Treat any attribute you leave out (rule sets, hostnames, routing policy, idle timeout, certificate) as something that may be reset. Always start from the current configuration, and change a non-production listener first.

Check what the listener accepts today

Start by recording the current listener configuration. You will need every value for the update.

LB=ocid1.loadbalancer.oc1..example

oci lb load-balancer get --load-balancer-id "$LB" \
  --query 'data.listeners' > listeners-before.json

oci lb load-balancer get --load-balancer-id "$LB" \
  --query 'data.listeners.*.{name:name,port:port,proto:protocol,ssl:"ssl-configuration"}' \
  --output table

The ssl-configuration block shows certificate-name (or certificate-ids if you use the OCI Certificates service), cipher-suite-name, protocols and server-order-preference.

Then confirm from outside what clients can actually negotiate:

HOST=app.example.com

# Should fail after the change
openssl s_client -connect $HOST:443 -servername $HOST -tls1_1 </dev/null 2>&1 | grep -E 'Protocol|Cipher|alert'

# Should succeed after the change
openssl s_client -connect $HOST:443 -servername $HOST -tls1_2 </dev/null 2>&1 | grep -E 'Protocol|Cipher'
openssl s_client -connect $HOST:443 -servername $HOST -tls1_3 </dev/null 2>&1 | grep -E 'Protocol|Cipher'

# Full enumeration, if nmap is available
nmap --script ssl-enum-ciphers -p 443 $HOST

Some OpenSSL 3 builds disable TLS 1.0/1.1 on the client side. In that case a failed -tls1_1 test proves nothing about the server. Use nmap, or a client build that still supports the old versions.

Choose a cipher suite

List what the load balancer can use. This covers predefined suites plus any custom suites already created on it:

oci lb ssl-cipher-suite list --load-balancer-id "$LB" \
  --query 'data[].{name:name,count:length(ciphers)}' --output table

oci lb ssl-cipher-suite get --load-balancer-id "$LB" \
  --name oci-tls-12-13-wider-ssl-cipher-suite-v1 --query 'data.ciphers'

Common predefined suites (names vary by region and release, so check the list output):

Suite TLS versions Use when
oci-default-ssl-cipher-suite-v1 1.2 Legacy default, TLS 1.2 only
oci-modern-ssl-cipher-suite-v1 1.2 TLS 1.2 only, stricter set
oci-compatible-ssl-cipher-suite-v1 1.1, 1.2 Avoid, it still allows TLS 1.1
oci-wider-compatible-ssl-cipher-suite-v1 All Deprecated. Contains every cipher, including weak ones
oci-tls-12-13-wider-ssl-cipher-suite-v1 1.2, 1.3 Typical target for public sites
oci-tls-13-recommended-ssl-cipher-suite-v1 1.3 TLS 1.3-only APIs with known modern clients
oci-tls-12-13-ssl-cipher-suite-v3 1.2, 1.3 Oracle recommends v3 suites where available

Predefined suites can't be edited or deleted. Oracle may also add new ones over time, so re-check the list before you standardise on a name.

Custom suite for a scanner baseline

If your security baseline lists exact ciphers, create a custom suite on that load balancer. The name must be unique, can't match a predefined name, and can't be changed later.

cat > ciphers.json <<'EOF'
[
  "TLS_AES_128_GCM_SHA256",
  "TLS_AES_256_GCM_SHA384",
  "TLS_CHACHA20_POLY1305_SHA256",
  "ECDHE-ECDSA-AES128-GCM-SHA256",
  "ECDHE-ECDSA-AES256-GCM-SHA384",
  "ECDHE-RSA-AES128-GCM-SHA256",
  "ECDHE-RSA-AES256-GCM-SHA384"
]
EOF

oci lb ssl-cipher-suite create --load-balancer-id "$LB" \
  --name corp-tls12-13-gcm-v1 --ciphers file://ciphers.json \
  --wait-for-state SUCCEEDED

Caution

Match ciphers to the certificate key type. ECDHE-RSA-* ciphers need an RSA certificate. ECDHE-ECDSA-* ciphers need an ECDSA certificate. A suite with only ECDSA ciphers on an RSA certificate breaks every TLS 1.2 handshake.

Update the listener

Build the update from the values in listeners-before.json. Only --protocols, --cipher-suite-name and --server-order-preference change. Everything else is copied from the current configuration.

oci lb listener update \
  --load-balancer-id "$LB" \
  --listener-name https-443 \
  --default-backend-set-name web-bs \
  --port 443 \
  --protocol HTTP \
  --ssl-certificate-name web-cert-2026 \
  --cipher-suite-name oci-tls-12-13-wider-ssl-cipher-suite-v1 \
  --protocols '["TLSv1.2","TLSv1.3"]' \
  --server-order-preference ENABLED \
  --rule-set-names '["security-headers","http-redirect"]' \
  --hostname-names '["app-example-com"]' \
  --connection-configuration-idle-timeout 60 \
  --force \
  --wait-for-state SUCCEEDED

Notes:

  • --protocol (singular) is the listener protocol (HTTP, HTTP2 or TCP). --protocols (plural) is the TLS version list. They are easy to mix up.
  • If the listener uses the OCI Certificates service, pass --ssl-certificate-ids '["ocid1.certificate..."]' instead of --ssl-certificate-name.
  • Add --routing-policy-name if the listener has one, and keep --ssl-verify-peer-certificate and --ssl-verify-depth if you use mutual TLS.
  • server-order-preference ENABLED makes the load balancer pick the cipher from its own order instead of the client's.

Compare before and after to prove nothing else changed:

oci lb load-balancer get --load-balancer-id "$LB" --query 'data.listeners' > listeners-after.json
diff <(jq -S . listeners-before.json) <(jq -S . listeners-after.json)

The only differences should be in ssl-configuration.

Terraform

If Terraform or Resource Manager manages the load balancer, make the change in code. Otherwise the next apply reverts it.

resource "oci_load_balancer_listener" "https" {
  # ...existing arguments...
  ssl_configuration {
    certificate_name        = "web-cert-2026"
    cipher_suite_name       = "oci-tls-12-13-wider-ssl-cipher-suite-v1"
    protocols               = ["TLSv1.2", "TLSv1.3"]
    server_order_preference = "ENABLED"
    verify_peer_certificate = false
  }
}

Backend sets with TLS to the backends

If the load balancer re-encrypts traffic to the backends, the backend set has its own SSL configuration, with separate cipher suite and protocol values. A scanner never sees it, but an internal audit might. Check it:

oci lb backend-set get --load-balancer-id "$LB" --backend-set-name web-bs \
  --query 'data."ssl-configuration"'

Before you restrict the backend side, confirm the backend servers support TLS 1.2. Old Java or IIS backends sometimes don't, and every backend then goes CRITICAL. Flag names for the backend-set update differ from the listener's, so check oci lb backend-set update --help for your CLI version.

Symptom → cause → fix

Symptom after the change Likely cause Fix
All clients get handshake failure Suite has no ciphers for the enabled protocols, or ciphers don't match the certificate key type Use a 1.2+1.3 suite. Include RSA ciphers for RSA certificates
Old clients (Windows 7, Java 7, embedded devices) fail, others work They only speak TLS 1.0/1.1 Expected. Upgrade the clients, or give them a separate listener with an exception approved by security
Redirects or headers disappeared --rule-set-names was left out of the update Re-run the update with the original rule set names
Wrong site served on a shared listener --hostname-names or routing policy was dropped Restore it from listeners-before.json
Terraform plan shows a change back Change was made outside code Update ssl_configuration in Terraform
Backends CRITICAL after a backend-set change Backend servers can't negotiate the new protocols Revert the backend-set SSL config, then upgrade the backends

Prevent it next time

  • Put cipher_suite_name and protocols in your Terraform module with a safe default (TLS 1.2 + 1.3), so new listeners never pick up the deprecated wide suite.
  • Re-check oci lb ssl-cipher-suite list once a quarter. When Oracle adds newer suites, such as v3 ones, decide whether to move to them.
  • Schedule an external TLS scan (for example nmap ssl-enum-ciphers) against every public listener and alert on TLS 1.0/1.1 or non-AEAD ciphers.
  • Keep listeners-before.json snapshots alongside change tickets, so a bad update can be reverted in one command.