testcontainers / testcontainers/testcontainers-java

[Bug]: Giving SSLHandshakeException while executing PATCH command

Offen
#9,197 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

type/bug
Vorherrschende Sprache
Java
Sterne
8.7k
Forks
1.9k
Ø Merge
2 T. 17 Std.
Gemergte PRs (30 T.)
9

Beschreibung

Module

K3S

Testcontainers version

1.20.1

Using the latest Testcontainers version?

Yes

Host OS

Windows

Host Arch

x86

Docker version
Client:
 Cloud integration: v1.0.29
 Version:           20.10.20
 API version:       1.41
 Go version:        go1.18.7
 Git commit:        9fdeb9c
 Built:             Tue Oct 18 18:28:44 2022
 OS/Arch:           windows/amd64
 Context:           default
 Experimental:      true

Server: Docker Desktop 4.13.1 (90346)
 Engine:
  Version:          20.10.20
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.18.7
  Git commit:       03df974
  Built:            Tue Oct 18 18:18:35 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.8
  GitCommit:        9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
 runc:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
What happened?

My K3S test container is up and I am able to create namespace, services etc. in it.

            V1Service service = new V1Service()
            .metadata(new V1ObjectMeta().name(serviceName).annotations(annotations))
            .spec(new V1ServiceSpec()
                    .addPortsItem(new V1ServicePort()
                            .port(80)
                            .targetPort(new IntOrString(8080)))
                    .selector(Collections.singletonMap("app", "my-app"))
                    .type("ClusterIP"));

    api.createNamespacedService(LHTestConstants.NAMESPACE, service).execute();

But when I try to run a PATCH command using the below code it gives a SSLHandshake error:

           V1Patch patch = new V1Patch(patchJson);
           V1Service patchedService = PatchUtils.patch(
                    V1Service.class,
                    () ->
                            coreV1Api.patchNamespacedService(
                                            serviceName,
                                            namespace,
                                            patch)
                                    .buildCall(null),
                    V1Patch.PATCH_FORMAT_JSON_PATCH);

Error: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Relevant log output
javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Additional Information

No response

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, den PATCH-Request im K3S-Test-Setup zu reproduzieren, und vergleiche ihn mit den erfolgreichen Namespace- und Service-Aufrufen, die im Issue gezeigt werden. Verfolge die von coreV1Api.patchNamespacedService und PatchUtils.patch verwendete SSL- und Zertifikatbehandlung; abgeschlossen ist die Aufgabe, wenn der PATCH-Befehl ohne die PKIX SSLHandshakeException erfolgreich ausgeführt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
docker, java, kubernetes
Bereich
api, infrastructure, testing
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.