-
Notifications
You must be signed in to change notification settings - Fork 33
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
Easily accessing "X509v3 Subject Alternative Name" #50
Comments
And that stringified object isn't even in any way consistent. I get "$VAR1 = '0...www.fysh.org..fysh.org';" for one and yet "$VAR1 = '03..squirrelmail.fysh.org';sm.fysh.org." for another, and "$VAR1 = '0..\rmail.fysh.org';" for yet another (using Data::Dumper there, and explicitly put the \r in the last one myself). So, is there a way to consistently turn that string back into some sort of object, even just an array ? |
I can see that the C .xs code is doing:
so thought perhaps Convert::ASN1 would help, but it doesn't seem to handle such strings either. Maybe I'm missing some trick with unpack() ? For now I've figured out that the two characters before each entry match /.[.\r]/, at least for my examples so far. |
Tough luck. Problem is, the Therefore I strongly suggest to create a new function After that, the resulting data still at least valid asn1. However, |
This issue seems to have been solved to some extent by ac9f148. |
I was looking at https://stackoverflow.com/questions/70174655/how-to-properly-obtain-san-using-perl-library-cryptopensslx509 It took me a while but I did figure it out:
|
Am I missing something or is the best you can do:
which in my case results in "0...www.fysh.org..fysh.org" being printed due to "FIXME: the value is returned as a string but may represent a complex object." ?
So I'm going to have to munge that string back into the list of alternate names, rather than have an object handed to me that I can somehow iterate over. I did try $x509->subject_name(), but that doesn't contain the alternates, i.e. the following prints "$subject_alternate_name = -1":
The text was updated successfully, but these errors were encountered: