Skip to content

Conversation

@wangke19
Copy link
Contributor

@wangke19 wangke19 commented Nov 26, 2025

### What Was Fixed:

This PR unrereverts the TLS 1.3 / Modern profile tests that were previously reverted in PR #30533 due to test failures. The original implementation was in PR #29611 for OCPBUGS-64799.

After investigation, the test failures were caused by two distinct bugs in the TLS tests:

Bug 1: TestTLSDefaults used direct connection instead of port-forwarding

Problem: The test attempted to connect directly to the external API server hostname from the kubeconfig (e.g., api.cluster5.ocpci.eng.rdu2.redhat.com). When running as a pod in the cluster (CI environment), the pod's internal DNS cannot resolve this external hostname, resulting in:

dial tcp: lookup api.cluster5.ocpci.eng.rdu2.redhat.com on 172.30.0.10:53: no such host

Fix: Updated TestTLSDefaults to use the same forwardPortAndExecute() approach as TestTLSMinimumVersions, which creates an oc port-forward tunnel to the apiserver service. This approach:

  • Works both in-cluster (CI) and externally (with kubeconfig)
  • Eliminates DNS resolution issues entirely
  • Is consistent with the TestTLSMinimumVersions pattern
  • Includes built-in retry logic (3 attempts)

Bug 2: TLS 1.3 doesn't support cipher suite configuration

Problem: The intermediate TLS profile allows both TLS 1.2 and TLS 1.3. When the client doesn't specify MaxVersion, it negotiates TLS 1.3 if the server supports it. TLS 1.3 does not support configuring cipher suites (they're predetermined by the spec), so specifying any cipher suite (RC4 or modern ciphers) has no effect. This caused the cipher suite validation test to incorrectly succeed when connecting with deprecated ciphers that should have been rejected.

Example observed behavior:

  • Client requests: TLS_ECDHE_ECDSA_WITH_RC4_128_SHA (0xC007)
  • With TLS 1.3 negotiated: Connection succeeds using TLS_AES_128_GCM_SHA256 (0x1301)

Fix: Constrain the cipher test to TLS 1.2 only to ensure cipher suite restrictions are actually tested:

cfg := &tls.Config{
    CipherSuites:       []uint16{cipher},
    MinVersion:         tls.VersionTLS12,
    MaxVersion:         tls.VersionTLS12,  // Forces TLS 1.2 so cipher suites are evaluated
    InsecureSkipVerify: true,
}

Additional fixes:

  • Fixed variable shadowing where err := conn.Close() shadowed the outer err from tls.Dial(), making the test check the wrong error
  • Renamed to dialErr and closeErr for clarity

IPv6 Support

Removed the IPv4-only restriction to enable tests on IPv6 clusters:

  • ✅ Tests now run on IPv4-only clusters
  • ✅ Tests now run on IPv6-only clusters
  • ✅ Tests now run on dual-stack (IPv4+IPv6) clusters

The tests use port-forwarding to localhost, which resolves appropriately in both IPv4 (127.0.0.1) and IPv6 (::1) environments.

Testing

Tested against live OpenShift cluster with both single-stack IPv4 and dual-stack IPv6 configurations:

SUCCESS! -- 2 Passed | 0 Failed | 0 Pending | 0 Skipped

Related Issues

References

@openshift-ci-robot
Copy link

Pipeline controller notification
This repository is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 26, 2025
@wangke19
Copy link
Contributor Author

/payload-job periodic-ci-openshift-release-master-nightly-4.21-e2e-metal-ipi-ovn-bm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 26, 2025

@wangke19: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-master-nightly-4.21-e2e-metal-ipi-ovn-bm

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/be3adcd0-ca92-11f0-97ec-df7a13906fc6-0

@wangke19
Copy link
Contributor Author

/payload-job periodic-ci-openshift-release-master-nightly-4.21-e2e-metal-ipi-ovn-bm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 26, 2025

@wangke19: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-master-nightly-4.21-e2e-metal-ipi-ovn-bm

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/7f1cfd90-caf5-11f0-9972-e7706940b560-0

@wangke19
Copy link
Contributor Author

/payload-job periodic-ci-openshift-release-master-nightly-4.21-e2e-agent-ha-dualstack-conformance

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 26, 2025

@wangke19: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-master-nightly-4.21-e2e-agent-ha-dualstack-conformance

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/92ceccb0-caf5-11f0-9c4d-d12e7d9d0fa5-0

@wangke19
Copy link
Contributor Author

/payload-job periodic-ci-openshift-release-master-nightly-4.21-e2e-metal-ipi-ovn-upgrade

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 26, 2025

@wangke19: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-master-nightly-4.21-e2e-metal-ipi-ovn-upgrade

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/ab7846b0-caf5-11f0-9605-34cb18c668c9-0

@wangke19
Copy link
Contributor Author

/payload-job periodic-ci-openshift-release-master-nightly-4.21-e2e-agent-ha-dualstack-conformance

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 27, 2025

@wangke19: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-master-nightly-4.21-e2e-agent-ha-dualstack-conformance

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/6ba60730-cb3a-11f0-8d31-f7a85637c458-0

@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@wangke19 wangke19 force-pushed the unrevert-tls-tests-with-fixes branch 2 times, most recently from 102a071 to 20e06a3 Compare November 27, 2025 07:32
@wangke19
Copy link
Contributor Author

/payload-job periodic-ci-openshift-release-master-nightly-4.21-e2e-metal-ipi-ovn-bm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 27, 2025

@wangke19: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-master-nightly-4.21-e2e-metal-ipi-ovn-bm

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/1ab2d0e0-cb64-11f0-8005-06e842255afc-0

@wangke19
Copy link
Contributor Author

/payload-job periodic-ci-openshift-release-master-nightly-4.21-e2e-agent-ha-dualstack-conformance

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 27, 2025

@wangke19: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-master-nightly-4.21-e2e-agent-ha-dualstack-conformance

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/25e247c0-cb64-11f0-9b6a-fc6039487e5f-0

@wangke19
Copy link
Contributor Author

/payload-job periodic-ci-openshift-release-master-nightly-4.21-e2e-metal-ipi-ovn-upgrade

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 27, 2025

@wangke19: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-master-nightly-4.21-e2e-metal-ipi-ovn-upgrade

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/2ffb6ca0-cb64-11f0-87e6-5149162538b8-0

@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@wangke19 wangke19 force-pushed the unrevert-tls-tests-with-fixes branch from 20e06a3 to 415e7eb Compare November 28, 2025 14:34
@wangke19 wangke19 marked this pull request as draft November 28, 2025 14:37
@wangke19
Copy link
Contributor Author

/payload-job periodic-ci-openshift-release-master-nightly-4.21-e2e-metal-ipi-ovn-bm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 28, 2025

@wangke19: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-master-nightly-4.21-e2e-metal-ipi-ovn-bm

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/d89f6d30-cc67-11f0-9540-2d1926f59e52-0

@wangke19
Copy link
Contributor Author

wangke19 commented Dec 2, 2025

/payload-job periodic-ci-openshift-release-master-nightly-4.21-e2e-rosa-sts-ovn

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 2, 2025

@wangke19: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-master-nightly-4.21-e2e-rosa-sts-ovn

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/4a609180-cf63-11f0-95ea-e884c70dd3df-0

@wangke19
Copy link
Contributor Author

wangke19 commented Dec 2, 2025

CI job periodic-ci-openshift-release-master-nightly-4.21-e2e-rosa-sts-ovn depends on openshift/release#72041

@wangke19 wangke19 changed the title [WIP] Unrevert tls tests with fixes Unrevert tls tests with fixes Dec 2, 2025
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 2, 2025
@jacobsee
Copy link
Member

jacobsee commented Dec 3, 2025

Regarding bug 1: Where is this url.Parse() used?
2: For posterity, I think it is clearer to say that the TLS intermediate profile in OpenShift allows TLS 1.2 or TLS 1.3, and the client will negotiate 1.3 if MaxVersion is unspecified and the server supports it. Then, once using TLS 1.3, setting cipher suites is unsupported, so specifying something like RC4 (or even any modern suite...) has no effect. That makes more sense to me than "Go 1.23+ silently upgrades deprecated ciphers".
3: 👍

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 3, 2025
@wangke19
Copy link
Contributor Author

wangke19 commented Dec 3, 2025

The failures of CI job periodic-ci-openshift-release-master-nightly-4.21-e2e-rosa-sts-ovn has been fixed in openshift/release#72041.

Update the comment explaining why cipher suite tests are constrained to
TLS 1.2 to be more technically accurate. The previous comment suggested
this was about "Go 1.23+ behavior", but the real issue is fundamental to
how TLS 1.3 works:

- The intermediate profile allows both TLS 1.2 and TLS 1.3
- Clients negotiate TLS 1.3 when MaxVersion is unspecified and server supports it
- TLS 1.3 spec predefines cipher suites and doesn't support configuration
- Therefore, specifying any cipher suite has no effect with TLS 1.3
- Forcing TLS 1.2 allows actual testing of cipher suite restrictions

This makes the reasoning clearer for future maintainers.
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 3, 2025
@wangke19
Copy link
Contributor Author

wangke19 commented Dec 3, 2025

/payload-job periodic-ci-openshift-release-master-nightly-4.21-e2e-rosa-sts-ovn

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 3, 2025

@wangke19: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-release-master-nightly-4.21-e2e-rosa-sts-ovn

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/9cfb89b0-d010-11f0-9fbd-4a66c14e5851-0

@openshift-ci-robot
Copy link

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@wangke19
Copy link
Contributor Author

wangke19 commented Dec 3, 2025

/test e2e-metal-ipi-ovn-ipv6

@wangke19
Copy link
Contributor Author

wangke19 commented Dec 3, 2025

/test e2e-aws-ovn-serial-1of2

@wangke19
Copy link
Contributor Author

wangke19 commented Dec 3, 2025

/test e2e-aws-ovn-serial-2of2

@wangke19
Copy link
Contributor Author

wangke19 commented Dec 3, 2025

/test e2e-metal-ipi-ovn-ipv6

@openshift-trt
Copy link

openshift-trt bot commented Dec 3, 2025

Job Failure Risk Analysis for sha: 4402603

Job Name Failure Risk
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 IncompleteTests
Tests for this run (20) are below the historical average (3012): IncompleteTests (not enough tests ran to make a reasonable risk analysis; this could be due to infra, installation, or upgrade problems)

1 similar comment
@openshift-trt
Copy link

openshift-trt bot commented Dec 3, 2025

Job Failure Risk Analysis for sha: 4402603

Job Name Failure Risk
pull-ci-openshift-origin-main-e2e-metal-ipi-ovn-ipv6 IncompleteTests
Tests for this run (20) are below the historical average (3012): IncompleteTests (not enough tests ran to make a reasonable risk analysis; this could be due to infra, installation, or upgrade problems)

@wangke19
Copy link
Contributor Author

wangke19 commented Dec 3, 2025

/retest

@wangke19
Copy link
Contributor Author

wangke19 commented Dec 3, 2025

/retest-required

1 similar comment
@jacobsee
Copy link
Member

jacobsee commented Dec 3, 2025

/retest-required

@openshift-trt
Copy link

openshift-trt bot commented Dec 3, 2025

Job Failure Risk Analysis for sha: 4402603

Job Name Failure Risk
pull-ci-openshift-origin-main-e2e-aws-ovn-serial-1of2 IncompleteTests
Tests for this run (21) are below the historical average (2111): IncompleteTests (not enough tests ran to make a reasonable risk analysis; this could be due to infra, installation, or upgrade problems)
pull-ci-openshift-origin-main-e2e-aws-ovn-serial-2of2 IncompleteTests
Tests for this run (21) are below the historical average (1949): IncompleteTests (not enough tests ran to make a reasonable risk analysis; this could be due to infra, installation, or upgrade problems)

@jacobsee
Copy link
Member

jacobsee commented Dec 4, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 4, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 4, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jacobsee, wangke19
Once this PR has been reviewed and has the lgtm label, please assign dgoodwin for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wangke19
Copy link
Contributor Author

wangke19 commented Dec 4, 2025

/retest-required

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 4, 2025

@wangke19: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants