Giter Club home page Giter Club logo

awscli's Introduction

AWSCLI

CMD:

aws iam upload-server-certificate --server-certificate-name example.com --certificate-body file://123455555.crt --private-key file://generated-private-key.txt --certificate-chain file://gd_bundle-g2-g1.crt

ERR: An error occurred (ValidationError) when calling the UploadServerCertificate operation: The specified value for privateKey is invalid. It must contain only printable ASCII characters.

openssl rsa -modulus -noout -in generated-private-key.txt | openssl md5 unable to load Private Key 23232356675675:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:701:Expecting: ANY PRIVATE KEY (stdin)= dffffdfghfg454645ytge35435 file generated-private-key.txt generated-private-key.txt: UTF-8 Unicode (with BOM) text

grep '^-----' generated-private-key.txt -----END PRIVATE KEY-----

tail -c +4 generated-private-key.txt > new_server.key

grep '^-----' new_server.key -----BEGIN PRIVATE KEY----- -----END PRIVATE KEY-----

aws iam upload-server-certificate --server-certificate-name example.com --certificate-body file://123455555.crt --private-key file://new_server.key --certificate-chain file://gd_bundle-g2-g1.crt { "ServerCertificateMetadata": { "ServerCertificateId": "123456789", "ServerCertificateName": "example.com", "Expiration": "2021-04-20T05:18:10Z", "Path": "/", "Arn": "arn:aws:iam::12345678:server-certificate/example.com", "UploadDate": "2019-01-25T05:04:07Z" } }

https://stackoverflow.com/questions/18460035/unable-to-load-private-key-pem-routinespem-read-biono-start-linepem-lib-c6

1

your .key file contains illegal characters. you can check .key file like this:

file server.key

output "server.key: UTF-8 Unicode (with BOM) text" means it is a plain text, not a key file. The correct output should be "server.key: PEM RSA private key".

use below command to remove illegal characters:

tail -c +4 server.key > new_server.key

The new_server.key should be correct.

For more detail, you can click here, thanks for the post.

https://blog.assarbad.net/20120920/ssl-error-with-a-newly-signed-cert/

awscli's People

Contributors

techact avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.