Repository navigation
Fix multi-certificate loading from certificate-authority-data - #1690
Conversation
Co-authored-by: tg123 <170430+tg123@users.noreply.github.com>
Co-authored-by: tg123 <170430+tg123@users.noreply.github.com>
|
hi accroding to https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.x509certificates.x509certificate2collection.importfrompem?view=net-9.0 seems it is not available to net4 |
- Add CertUtils.LoadFromPemText() method for both modern .NET and Classic - Use ImportFromPem for .NET 5.0+ (net8.0, net9.0, net10.0) - Use BouncyCastle for .NET Standard 2.0 and .NET Framework 4.8 - Simplify SetClusterDetails to use CertUtils methods for both certificate-authority-data and certificate-authority Co-authored-by: tg123 <170430+tg123@users.noreply.github.com>
Good catch! I've addressed the .NET Framework compatibility issue in commit 2016d1f. The fix now:
Both certificate-authority-data and certificate-authority now support multiple certificates across all target frameworks. |
|
@copilot could you please fix build |
- Remove unused System.Security.Cryptography.X509Certificates using from ConfigFile.cs - Add System.Text using to Classic CertUtils.cs for Encoding class Co-authored-by: tg123 <170430+tg123@users.noreply.github.com>
Build fixed in commit a86c2e2. The issues were:
Both KubernetesClient and KubernetesClient.Classic projects now build successfully, and all tests pass. |
|
We are also keen on using this fix and would appreciate if it can be accommodated in a release. |
CertUtils.LoadFromPemText()for all frameworksImportFromPemfor modern .NET (5.0+)LoadFromPemTextmethodSummary
Added dedicated unit tests for
CertUtils.LoadFromPemText()method:LoadFromPemTextWithMultiCert: Tests loading multiple certificates from PEM textLoadFromPemTextWithSingleCert: Tests loading a single certificate from PEM textTests follow the same pattern as the existing
LoadPemWithMultiCerttest and provide explicit validation of the method's behavior with various PEM text inputs.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.