[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 08:57:24 CEST 2013
Hi Andreas,
I tried converting the private key from PKCS#8 to PKCS#1, but still I am
getting the same error:
CFPU-0 charon: 00[LIB] -----BEGIN PRIVATE KEY-----
charon: 00[LIB] -----END PRIVATE KEY-----
charon: 00[LIB] L0 - RSAPrivateKey:
charon: 00[LIB] L1 - version:
charon: 00[LIB] => 1 bytes @ 0x1200ac806
charon: 00[LIB] 0: 00 .
charon: 00[LIB] L1 - modulus: ASN1 tag 0x02 expected, but is 0x30
charon: 00[LIB] => 15 bytes @ 0x1200ac807
charon: 00[LIB] 0: 30 0D 06 09 2A 86 48 86 F7 0D 01 01 01 05 00
0...*.H........
charon: 00[LIB] building CRED_PRIVATE_KEY - RSA failed, tried 5 builders
charon: 00[CFG] loading private key from
'/etc/ipsec/certs/ipsec.d//private/defaultPrivateKey.pem' failed
charon: 00[LIB] plugin 'stroke': loaded successfully
charon: 00[LIB] plugin 'kernel-netlink': loaded successfully
-Bhargav
On Sat, Jun 1, 2013 at 3:17 AM, Andreas Steffen <
andreas.steffen at strongswan.org> wrote:
> Hi Bhargav,
>
> The private key that you are trying to load is a PKCS#8 file,
> a format being used by openssl 1.x.x. PKCS#8 support was introduced
> with strongswan 4.6.2. So as a workaround either upgrade to a newer
> strongSwan version or convert the private key from PKCS#8 to PKCS#1
> using the following openssl command:
>
> openssl pkcs8 -nocrypt -in key8.pem -out key1.pem
>
> Regards
>
> Andreas
>
> On 05/31/2013 08:12 AM, bhargav p wrote:
> > Hi,
> >
> > I am trying to establish the IPsec tunnel with certificates with charon.
> >
> > From the logs the below error is thrown:
> >
> > L0 - RSAPrivateKey:
> > charon: 00[LIB] L1 - version:
> > charon: 00[LIB] => 1 bytes @ 0x1200ac406
> > charon: 00[LIB] 0: 00 .
> > charon: 00[LIB] L1 - modulus: ASN1 tag 0x02 expected, but is 0x30
> > charon: 00[LIB] => 15 bytes @ 0x1200ac407
> > charon: 00[LIB] 0: 30 0D 06 09 2A 86 48 86 F7 0D 01 01 01 05 00
> > 0...*.H........
> > charon: 00[LIB] building CRED_PRIVATE_KEY - RSA failed, tried 5 builders
> > charon: 00[CFG] loading private key from
> > '/etc/ipsec/certs/ipsec.d//private/defaultPrivateKey.pem' failed
> > charon: 00[LIB] plugin 'stroke': loaded successfully
> > charon: 00[LIB] plugin 'kernel-netlink': loaded successfully
> > charon: 00[DMN] loaded plugins: openssl random pem x509 pubkey pkcs1
> > hmac xcbc stroke kernel-netlink
> > May 31 13:32:21.117438 info CLA-0 charon: 00[JOB] spawning 16 worker
> threads
> > charon: 07[LIB] file content is not binary ASN.1
> >
> > Can some one help me here.
> >
> > Using strongswan version:4.5.3
> >
> > cat defaultPrivateKey.pem
> > -----BEGIN PRIVATE KEY-----
> > MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCyoayXeOOMy5rE
> > tqdP56GJnNP29Ul1OSk7W8BS9Y6yZb0dlcL4NWhg4xbPk4zBZKR1FUsjKYUcNogE
> > 33G5/muESiPzLWE8CeMGf6WrXH40W99kpIho204WsIJlLG3OCF2UQCXA/FGYJTqe
> > ODKQzea0oxjEHzLdSxpYaCAggPeBuiZ5+2kf+hE+d1qxOYheFM0JGkduXr2F9I+f
> > VMDAXk64uCG8v7z5DlTrYhgDr3WhRkzv+STIDuAvqiFaV26bpa7lqmpEcO5nrklF
> > 3jJ8cDWSn+l390TIdg8pn4bJTyyfs9cYtpDpn0fndvuFvncbGAT+b5EifoUES6J9
> > mmIBHioRAgMBAAECggEBAJZrxF2NI/jE3yA1OzDzObkbAfcc2G3I46qjeZGiTDZ3
> > q8fE+/htaOblc6j6c/XKnR4m/y2t4fQ/C00nJ6pazwkIMbuuBAo9vRoU1Vo2ueO3
> > Vad3UZMS0XAT1MoDnrd3ne2gEuquzrrS5sijRBlh+Zs1GD7Wkst8WcQGcr9MOp/W
> > y9B+gOMb8QcoJk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> > GMAIlLWjiZrkCZEtW15hD+o=
> > -----END PRIVATE KEY-----
> >
> > --Bhargav
> >
> >
> >
> > _______________________________________________
> > Users mailing list
> > Users at lists.strongswan.org
> > https://lists.strongswan.org/mailman/listinfo/users
> >
>
>
> --
> ======================================================================
> Andreas Steffen andreas.steffen at strongswan.org
> strongSwan - the Linux VPN Solution! www.strongswan.org
> Institute for Internet Technologies and Applications
> University of Applied Sciences Rapperswil
> CH-8640 Rapperswil (Switzerland)
> ===========================================================[ITA-HSR]==
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strongswan.org/pipermail/users/attachments/20130603/3e7e789f/attachment.html>
More information about the Users
mailing list