[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1430
  • Last Modified:

EC2 not working on a mac

I followed the this link http://www.robertsosinski.com/2008/01/26/starting-amazon-ec2-with-mac-os-x/ but am unable to connect via the command line.

Here's the error and the .bash_profile

export EC2_HOME=~/.ec2
export PATH=$PATH:$EC2_HOME/bin
export EC2_PRIVATE_KEY=`ls $EC2_HOME/pk-*.pem`
export EC2_CERT=`ls $EC2_HOME/cert-*.pem`
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home/




org.codehaus.xfire.fault.XFireFault: Signature creation failed; nested exception is:
      java.security.spec.InvalidKeySpecException: java.lang.ClassCastException: org.bouncycastle.asn1.DERSequence cannot be cast to org.bouncycastle.asn1.DERInteger
      at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89)
      at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:83)
      at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114)
      at org.codehaus.xfire.client.Client.invoke(Client.java:336)
      at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
      at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
      at $Proxy12.describeImages(Unknown Source)
      at com.amazon.aes.webservices.client.Jec2Impl.describeImages(Jec2Impl.java:459)
      at com.amazon.aes.webservices.client.cmd.DescribeImages.invokeOnline(DescribeImages.java:157)
      at com.amazon.aes.webservices.client.cmd.BaseCmd.invoke(BaseCmd.java:854)
      at com.amazon.aes.webservices.client.cmd.DescribeImages.main(DescribeImages.java:181)
Caused by: org.apache.ws.security.WSSecurityException: Signature creation failed; nested exception is:
      java.security.spec.InvalidKeySpecException: java.lang.ClassCastException: org.bouncycastle.asn1.DERSequence cannot be cast to org.bouncycastle.asn1.DERInteger


0
timz955
Asked:
timz955
1 Solution
 
roylongCommented:
At what step in the instructions are you getting the error?

What version of OS X?
0
 
timz955Author Commented:
When I run any EC2 console command.
0
 
khairilCommented:
Hi,

I think you need to have valid certificate. You can check this using your Keychain whether the cert install successfully or not.

Apple is so picky with cert, so make sure that you have valid one.
0
 
jan-janssenCommented:
I suggest you stick to the official guide line, rather than a user experience:
http://mturk.s3.amazonaws.com/CLT_Tutorial/UserGuide.html

Nevertheless what you describe definitely is an certificate issue, caused by your certificate being private rather than public, for more information on this issue see:
https://forums.aws.amazon.com/thread.jspa?threadID=29617

I am asking, because I can provoke the same behaviour with this command:
ec2dim -K cert-XXX.pem -C cert-XXX.pem

Open in new window


It works with this:
ec2dim -K pk-XXXpem -C cert-YYY.pem

Open in new window



Another post in the official forums which exactly handles your issue can be found here:
https://forums.aws.amazon.com/message.jspa?messageID=91344 
That should fix your problems.
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Tackle projects and never again get stuck behind a technical roadblock.
Join Now