mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-08-04 08:23:37 +00:00
Augment parseX509Output to also work with libressl
LibreSSL uses a different output separated and semantics, which broke the X509 parser. With some slight modifications both can be supported.
This commit is contained in:
@@ -741,10 +741,11 @@ const internalCertificate = {
|
||||
*/
|
||||
parseX509Output: (line, prefix) => {
|
||||
// Remove the subject= part
|
||||
const subject_value = line.slice(prefix.length);
|
||||
const subject_value = line.slice(prefix.length).trim();
|
||||
|
||||
const subject = subject_value.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/)
|
||||
.map( (e) => { return e.trim().split(' = ', 2); })
|
||||
const subject = subject_value.split(/[,/](?=(?:(?:[^"]*"){2})*[^"]*$)/)
|
||||
.filter( (e) => { return e.length > 0; } )
|
||||
.map( (e) => { return e.trim().split('=', 2).map( (p) => { return p.trim(); }); })
|
||||
.reduce((obj, [key, value]) => {
|
||||
obj[key] = value.replace(/^"/, '').replace(/"$/, '');
|
||||
return obj;
|
||||
|
Reference in New Issue
Block a user