Skip to content
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

"Create CSR error" on FreeBSD #4160

Closed
ntrs opened this issue Jun 27, 2022 · 2 comments
Closed

"Create CSR error" on FreeBSD #4160

ntrs opened this issue Jun 27, 2022 · 2 comments

Comments

@ntrs
Copy link

ntrs commented Jun 27, 2022

Running on FreeBSD 13.1 fails with "Create CSR error.":

sh acme.sh --issue --dns -d example.org -d '*.example.org' --server letsencrypt --log --debug
...
[Thu Jun 23 18:29:01 MSK 2022] _createcsr
[Thu Jun 23 18:29:02 MSK 2022] !!! ='рсЯ:*.example.org'
[Thu Jun 23 18:29:02 MSK 2022] Multi domain='рсЯ:example.org,рсЯ:*.example.org'
Error Loading request extension section v3_req
34389172224:error:22075075:X509 V3 routines:v2i_GENERAL_NAME_ex:unsupported option:/usr/src/crypto/openssl/crypto/x509v3/v3_alt.c:552:name=рсЯ
34389172224:error:22098080:X509 V3 routines:X509V3_EXT_nconf:error in extension:/usr/src/crypto/openssl/crypto/x509v3/v3_conf.c:47:name=subjectAltName, value=рсЯ:example.org,рсЯ:*.example.org
[Thu Jun 23 18:29:02 MSK 2022] Create CSR error.
...

This is because _upper_case() function uses tr 'a-z' 'A-Z', but the behavior of FreeBSD's tr is changed some time ago:

$ uname -a
FreeBSD test.example.org 10.0-CURRENT FreeBSD 10.0-CURRENT #11 r247389M: Wed Feb 27 13:38:19 MSK 2013     
$ echo dns | tr 'a-z' 'A-Z'  
DNS

$ uname -a
FreeBSD test.example.org 11.0-RELEASE-p1 FreeBSD 11.0-RELEASE-p1 #1: Wed Oct 26 15:02:47 MSK 2016     
$ echo dns | tr "a-z" "A-Z"
рсt

$ uname -a
FreeBSD test.example.org 13.1-RELEASE FreeBSD 13.1-RELEASE releng/13.1-n250148-fc952ac2212 GENERIC amd64
$ echo dns | tr "a-z" "A-Z"
рсЯ

The solution is to check for FreeBSD (as it is done for Solaris) and use tr '[:lower:]' '[:upper:]' instead.

@Neilpang
Copy link
Member

good catch.
I will fix it soon.

@Neilpang Neilpang reopened this Jul 12, 2022
nik736 pushed a commit to nik736/acme.sh that referenced this issue Jul 16, 2022
@ketas
Copy link

ketas commented Apr 17, 2024

it did bite my ass right now as it's not fixed yet, eh?

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

No branches or pull requests

3 participants