This references an environment variable that contains the required Subject Name: -
export CRT_SUBJ="/C=US/ST=New York/L=Armonk/O=International Business Machines Corporation/CN=securebuildserver"
When I reference this variable in my Dockerfile: -
RUN openssl req -new -x509 -nodes -out server.crt -keyout server.key -subj $CRT_SUBJ
this fails with: -
unknown option York/L=Armonk/O=International
req [options]
Note that it's failing to digest the Subject Name, specifically at the first space character, between New and York.
The solution ?
Wrap the environment variable in double-quotes: -
RUN openssl req -new -x509 -nodes -out server.crt -keyout server.key -subj "$CRT_SUBJ"
which works a treat ......
No comments:
Post a Comment