[strongSwan] loading private key file is failing with charon, when trying to establish IPsec tunnel with certifiactes.
bhargav p
bhargav.1226 at gmail.com
Mon Jun 3 12:07:52 CEST 2013
Hi Tobias/Andreas,
Sorry for spamming.
After trying the below command:
openssl rsa -in defaultPrivateKey.pem -out defaultPrivateKey1.pem
sizes for both the files are same:
And cat on the two files:
# cat defaultPrivateKey.pem
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAsqGsl3jjjMuaxLanT+ehiZzT9vVJdTkpO1vAUvWOsmW9HZXC
+DVoYOMWz5OMwWSkdRVLIymFHDaIBN9xuf5rhEoj8y1hPAnjBn+lq1x+NFvfZKSI
aNtOFrCCZSxtzghdlEAlwPxRmCU6njgykM3mtKMYxB8y3UsaWGggIID3gbomeftp
H/oRPndasTmIXhTNCRpHbl69hfSPn1TAwF5OuLghvL+8+Q5U62IYA691oUZM7/kk
yA7gL6ohWldum6Wu5apqRHDuZ65JRd4yfHA1kp/pd/dEyHYPKZ+GyU8sn7PXGLaQ
6Z9H53b7hb53GxgE/m+RIn6FBEuifZpiAR4qEQIDAQABAoIBAQCWa8RdjSP4xN8g
NTsw8zm5GwH3HNhtyOOqo3mRokw2d6vHxPv4bWjm5XOo+nP1yp0eJv8treH0PwtN
JyeqWs8JCDG7rgQKPb0aFNVaNrnjt1Wnd1GTEtFwE9TKA563d53toBLqrs660ubI
o0QZYfmbNRg+1pLLfFnEBnK/TDqf1svQfoDjG/EHKCZIsnpyiBrLchRS1HfCFrcy
6T1SmAAX48PqiBZmZ6Nvmd7lpxOozIfCe7FhV0MgbXMpYXfY8RqT5/YD5LeL/ZFj
Htvj3e7wm0TEK1Rsd4SLlEmi6XjddYS7AiRmkmPsuMHeT+XGy+vzr3lNHhIFJUOS
2MeQ54BRAoGBAOAo7Q5qwF5zGUmwFrq4g/SI7BIQcGNMWEF7XjattejWADtu3vh5
erHlxtQCDysaWwPsvWcDkIQwPWnQlX2R83dJO0KlcxIMiKPYDWt9MxiGjwRtw2Ch
Su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x+/+DDfHT+YMwX7QhbOUhRIk4mDA7dQH3r3SGmOq8WBmK3BU
+2V4Q68QsFRROVGgkgVcm6xYR0oApxr68OFNXg28v9ktfFQltRGNDvZUAXlujQDx
g8w2tQKBgBRqVxD2XxFdEW2Tu3SzDTt8dTs++RxnZC6Ldwr3Okbi6/LsZ0Mxj00N
xXDTJ5Sx544XZgfvazKWZQ94JsSlb+91HyXePqD+VX1qwBHDAGQl6ybKdU4xAsAK
eEK77/miWSPnPamIUYbqEzBxvjSzChjACJS1o4ma5AmRLVteYQ/q
-rw-r--r-- 1 root root 1675 Jun 3 12:36 defaultPrivateKey.pem
-rw-r--r-- 1 root root 1675 Jun 3 12:49 defaultPrivateKey1.pem
Still I am getting the same error. Is anything I am doing wrong.
-Bhargav
On Mon, Jun 3, 2013 at 3:17 PM, Tobias Brunner <tobias at strongswan.org>wrote:
> Hi Bhargav,
>
> > openssl pkcs8 -nocrypt -in key8.pem -out key1.pem
>
> Unfortunately, this command produces another PKCS#8 encoded file.
>
> Please try
>
> openssl rsa -in key8.pem -out key1.pem
>
> to export the RSA key in PKCS#1 format.
>
> Regards,
> Tobias
>
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strongswan.org/pipermail/users/attachments/20130603/6a0d18d1/attachment.html>
More information about the Users
mailing list