Skip to content
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

StrERROR: Problem with the local SSL certificate #256

Open
jason-i-vv opened this issue Nov 26, 2024 · 4 comments
Open

StrERROR: Problem with the local SSL certificate #256

jason-i-vv opened this issue Nov 26, 2024 · 4 comments

Comments

@jason-i-vv
Copy link

test ./list_pod_bin failed ,because of SSL certificate,

this is my kube config:

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMvakNDQWVhZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJME1EUXdNVEV3TlRNME1sb1hEVE0wTURNek1ERXdOVE0wTWxvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTTFhCjVrY3k0d094bVhmcW1TZll0dEdIRjg5N3JOM0wrV2haRHRlbzQreEZNT1hEcnVGK0RGOUFqcFRodWVWVUttQ3IKUTFWb0svYS9Id0d3ZlMxQ2VwaXZoN1FRbGV2YXp6UkhVcW1JdUtwcW95akNJRjBOK3E3QU16alI1dVRmeVZiTQpjTjFRTmFwZm95RFZyYVN2UGtVcysvYmVQS0hFYTBiL1dXWDRhSjBudGhUQmdPNGwwSkk3b2hoY1FDWjV4OHhFClF5QlZjYnZnSksvU09rWkxKRTAxSHYyS3RGeWZGV3FycnVuR25WdEtreWR5ajZXMFZiaitJK0JNRk0wS056SUkKTkp6RlB4NDExNVhWMFJoWlE1WjBqRnRBNUdHaXU0UTM5RjdwRjNFSUl4azd1bDN6MDl0WXN6MFNZTUJCVFNIZAo1MHVlL0ZlaHp1MU1UM3UrdGNNQ0F3RUFBYU5aTUZjd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0hRWURWUjBPQkJZRUZGUEVlenNYSmw0ekdQUitjYlpNZG0vRHBtUStNQlVHQTFVZEVRUU8KTUF5Q0NtdDFZbVZ5Ym1WMFpYTXdEUVlKS29aSWh2Y05BUUVMQlFBRGdnRUJBR01LYk5jN0k0d3pvZ3ZPaDI1RgpiK3dOUFRWRGFBTWJwVTZuWEhKcHdJVGgxNXRUVGdESzF1MWdmVmtvZXVMc2crc0NMaUN0SStjRGtEUEczZVdMCnhOYmo4MlQyZGgwVHF3cXM3RXpnOE5BRGh3WXJLcm8xbi9XMG1jQlBleTFmd3VlT0dLTUY2ZXoyMExkVjEwdVYKcnQ5bzFxQ0l3VlNhQUd6bVVzdXlSM3k1YU40eklWckxpbUVjT2RVdkVPWGtNa3NtYm9Bd053bnREUXZzSUVsRwpIN3dEOUJPdG05TlY2NnROb1RqNldCNC9DNktEMnhaalNWbzZiZ09Rdi8wS0oxRi9YcnpNODE0ak1oSkxMbFVPCnI4SkpTTVl4NHpzeWVoaGcrd3lySFVERTA0ZkVJcGFya1RXemNHSFJwN1k4MHN5VytDUi9hQnlQN1R6NFFFd2EKMlFvPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
    server: https://10.16.128.121:6443
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    namespace: default
    user: mapping-admin
  name: mapping-admin@kubernetes
current-context: mapping-admin@kubernetes
kind: Config
users:
- name: mapping-admin
  user:
    client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNNRENDQVJnQ0ZFLy9aUXZsaGxtRTNsSlVGMFA4SVR1c09JRTRNQTBHQ1NxR1NJYjNEUUVCQ3dVQU1CVXgKRXpBUkJnTlZCQU1UQ210MVltVnlibVYwWlhNd0hoY05NalF3TkRBeE1UQTFPREF6V2hjTk16UXdNek13TVRBMQpPREF6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copy link
Author

  • Trying 10.16.128.121:6443...
  • Connected to 10.16.128.121 (10.16.128.121) port 6443 (#0)
  • ALPN, offering h2
  • ALPN, offering http/1.1
  • could not load PEM client certificate, OpenSSL error error:0A00018F:SSL routines::ee key too small, (no key found, wrong pass phrase, or wrong file format?)
  • Closing connection 0
    curl_easy_perform() failed

@ityuhui
Copy link
Member

ityuhui commented Nov 26, 2024

I tried in my env using kind, the client works.

Have you tried with kubectl commandline to fetch a pod ? e.g. kubectl get po -A

@jason-i-vv
Copy link
Author

yes,kubectl get po is ok . And i print some logs for debug.

./list_pod_bin
user->client_certificate_data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNNRENDQVJnQ0ZFLy9aUXZsaGxtRTNsSlVGMFA4SVR1c09JRTRNQTBHQ1NxR1NJYjNEUUVCQ3dVQU1CVXgKRXpBUkJnTlZCQU1UQ210MVltVnlibVYwWlhNd0hoY05NalF3TkRBeE1UQTFPREF6V2hjTk16UXdNek13TVRBMQpPREF6V2pBWU1SWXdGQVlEVlFRRERBMXRZWEJ3YVc1bkxXRmtiV2x1TUlHZk1BMEdDU3FHU0liM0RRRUJBUVVBCkE0R05BRENCaVFLQmdRRGI4ZXB4T3Q3YXdBZGU3RGVjTzlxdTVIdFJseEFaRldxQ1cxenZJWXJ4UDEwbmF1YXcKVHppVElxaXhHYndBNnpjYmoyQnl6WHBxR0NlWjNHbVJJUmtXeTVxVzg2eTUxcXZxbFpkZzRzbEpHWUpJWVozTwpwWVQyVjZtS0pPcms0S29POGtDZ3V0bjlaLzhGWDJRWmpid1RzeE5ydTI3WXB0bmw5VXRQcHR2MHZRSURBUUFCCk1BMEdDU3FHU0liM0RRRUJDd1VBQTRJQkFRQ25Pa2Z6TDFVcEM5VUpXZzBiK3MvSVlFUVRqY2lxTjIvUnc4MzgKZ0QxOTU0cWFEOHNiaElObktHUGNDa1dzWkhUMHYwbk9MMXBKVlZxL1l5amRGK1k4dVJhbDdnVTY5OStuWlNKTApK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fig-E9jEyy
rc = 0
apiClient = 0x563e5d370720
apiClient->basePath = https://10.16.128.121:6443
apiClient->sslConfig = 0x563e5d371ba0
apiClient->response_code = 0
apiClient->dataReceived = (nil)
apiClient->dataReceivedLen = 0
localVarPath: /api/v1/namespaces/default/pods
localVarBodyParameters: (null)
*   Trying 10.16.128.121:6443...
* Connected to 10.16.128.121 (10.16.128.121) port 6443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* could not load PEM client certificate, OpenSSL error error:0A00018F:SSL routines::ee key too small, (no key found, wrong pass phrase, or wrong file format?)
* Closing connection 0
curl_easy_perform() failed

URL: https://10.16.128.121:6443/api/v1/namespaces/default/pods
IP: 10.16.128.121
PORT: 6443
SCHEME: HTTPS
StrERROR: Problem with the local SSL certificate
The return code of HTTP request=0
Cannot get any pod.

@ityuhui
Copy link
Member

ityuhui commented Nov 30, 2024

I'm guessing it's a bug that the client certificate is being truncated before being provided to the API server. Perhaps your client certificate is longer than the buffer. Can you do some investigation to print the contents of the client certificate or debug this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants