testcontainers / testcontainers/testcontainers-java

[Bug]: Giving SSLHandshakeException while executing PATCH command

オープン
#9,197 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

type/bug
主要言語
Java
スター
8.7k
フォーク
1.9k
平均マージ
2日 17時間
マージ済み PR(30日)
9

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、K3S テストセットアップで PATCH リクエストを再現し、issue に示されている成功した namespace および service の呼び出しと比較します。coreV1Api.patchNamespacedService と PatchUtils.patch で使用されている SSL および証明書の処理を追跡します。PATCH コマンドが PKIX SSLHandshakeException なしで成功すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
docker, java, kubernetes
領域
api, infrastructure, testing
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。