HewlettPackard / HPEStoragePowerShellToolkit

A PowerShell Toolkit to manage HPE Storage devices including the HPE Nimble Storage, 3PAR, Primera, Alletra 6000, and Alletra 9000 Platforms.
BSD 3-Clause "New" or "Revised" License
5 stars 1 forks source link

ResolveIPtoHost assumes fixed location of CN in cert subject #7

Closed wwtorrey closed 3 months ago

wwtorrey commented 5 months ago

In the function ResolvePtoHost the CN location is assumed to be in a fixed location in the certificate subject. Suggest change to locate CN in subject and grab value.

$global:certhostname = ($CertSubject.Split(',').trim() | Where-Object {$ -like 'CN=*'}).SubString(3)

File: MSA.scripts\helpers.ps1:629

chris-lionetti commented 3 months ago

This is an excellent modification. I have solved this in two ways..the master module now contains an 'Import-HPESANCertificate' command which will import the certificate for you, or via your fix the embedded ResolveIPToHost is also now working.

chris-lionetti commented 3 months ago

Thank you for your contribution