Skip to content

Problems making certificate request #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jkarttunen opened this issue Aug 30, 2017 · 15 comments
Open

Problems making certificate request #1

jkarttunen opened this issue Aug 30, 2017 · 15 comments
Labels

Comments

@jkarttunen
Copy link

When running ./setup.sh, i get

Generating RSA private key, 2048 bit long modulus
..................................................+++
.....................................+++
e is 65537 (0x10001)
+ openssl req -sha256 -new -key key.pem -out csr.pem -config server-config
problems making Certificate Request
140529749358232:error:0D07A098:asn1 encoding routines:ASN1_mbstring_ncopy:string too short:a_mbstr.c:151:minsize=1
@davidmoten
Copy link
Owner

davidmoten commented Aug 30, 2017 via email

@davidmoten
Copy link
Owner

davidmoten commented Aug 30, 2017 via email

@davidmoten
Copy link
Owner

Closing because of inactivity.

@srinivas0v
Copy link

hello david,
I tried to run the setup.sh and got the same error. So what's the fix for this error? I really appreciate you if you could help me with this problem.

Thank you

@davidmoten
Copy link
Owner

davidmoten commented Mar 15, 2018

Hi, my googling suggests this happens when you don't specify one of the fields in the block at the top of setup.sh. Don't leave ORG_UNIT blank for instance and perhaps make sure it has at least 2 characters.

@ghost
Copy link

ghost commented Mar 21, 2018

I get this too.please your help
me@me:/opt/HighGo/Develop/bin$ ./createopenssl.sh
Generating a 2048 bit RSA private key
...........................+++
..+++
writing new private key to 'privkey.pem'

problems making Certificate Request
140466674001152:error:0D07A098:asn1 encoding routines:ASN1_mbstring_ncopy:string too short:../crypto/asn1/a_mbstr.c:102:minsize=1
writing RSA key

@davidmoten davidmoten reopened this Mar 21, 2018
@davidmoten
Copy link
Owner

@liguangxian
What did you put in this block in setup.sh?:

HOSTNAME='ec2-52-63-456-123.ap-southeast-2.compute.amazonaws.com'
COUNTRY='AU'
STATE='Australian Capital Territory'
CITY='Canberra'
ORG='MyCompany'
ORG_UNIT='IT'
EMAIL='somebody@gmail.com'

@ghost
Copy link

ghost commented Mar 22, 2018

@davidmoten

first, thank you,this is my setup.sh

``#!/bin/bash

data="$1"

openssl req -nodes -days 1000000 -new -text -subj "/C=US/ST=Illinois/L=Chicago/O=IT/CN="${data} -out /opt/HighGo/Develop/data/server.req
openssl rsa -in privkey.pem -out /opt/HighGo/Develop/data/server.key
rm privkey.pem
openssl req -x509 -in /opt/HighGo/Develop/data/server.req -text -key /opt/HighGo/Develop/data/server.key -out /opt/HighGo/Develop/data/server.crt
chown -R $LOGNAME /opt/HighGo/Develop/data/server.key /opt/HighGo/Develop/data/server.crt /opt/HighGo/Develop/data/server.req
chmod 600 /opt/HighGo/Develop/data/server.key``

@davidmoten
Copy link
Owner

You need an OU entry as well

@rknell
Copy link

rknell commented Apr 12, 2018

It was org unit blank that did it for me

@gjs68
Copy link

gjs68 commented Jul 12, 2019

also check in openssl.cnf what the default max setting is,
(ran into a Country > 2 characters requirement issue, producing a similar error)

@snydergd
Copy link

snydergd commented Jun 9, 2023

For me it was that one of the values started with a "#" and was not quoted. This commented out the remainder of the line and value. It was a stupid mistake, but surrounding this value in quotes resolved that issue easy enough.

@davidmoten
Copy link
Owner

@snydergd thanks for that. What base image did you use? I should update the readme with a later version of Ubuntu!

@snydergd
Copy link

@davidmoten I was just commenting on what configuration for openssl could cause this error, since I came across this thread for the error message matching what I received while using it. I assumed anyone else hitting the issue here might be for the same reason as I was. It seems like a user error scenario rather than an issue with this repo, but all the same I thought I would share my experience here for interested passers-by.

@creatormir
Copy link

In addition to the country, it was also required to set city

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants