opnsense / core

OPNsense GUI, API and systems backend
https://opnsense.org/
BSD 2-Clause "Simplified" License
3.28k stars 727 forks source link

TLS certificate type defaults to "Client" while editing #7835

Closed zbig-t closed 3 weeks ago

zbig-t commented 3 weeks ago

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug

When editing a server certificate in "System / Trust / Certificates", the GUI form incorrectly defaults to type "Client"

To Reproduce

Steps to reproduce the behavior:

  1. Generate a certificate of type "Server" using OPNsense GUI
  2. Click on "i" to show certificate info and confirm it indeed has "X509v3 Extended Key Usage" extension set to "TLS Web Server Authentication" and "Netscape Cert Type" to "SSL Server"
  3. Click the pencil icon to edit the certificate, e.g. to add an Alternative Name you forgot
  4. See how the "Type" dropdown says "Client certificate" and indeed, when not caught, the cert gets recreated as a client one

Expected behavior

Cert editing GUI respects the original cert type and reflects it in properly preselecting the "Type" dropdown

Describe alternatives you considered

Being vigilant and correcting the "Type" dropdown selection manually.

Screenshots

I believe the text description says it all pretty accurately.

Relevant log files

N/A

Additional context

N/A

Environment

Software version used and hardware type if relevant, e.g.:

OPNsense 24.7.1 (amd64).

AdSchellevis commented 3 weeks ago

https://github.com/opnsense/core/commit/f29d93198d9cdfd04616c1e380319cf0f70fa1a9 should do the trick