Certbot: error: unrecognized arguments: –nginx

when i visit my domain,i get a 404 not found error,if i edit it as https://www.work-shine.com by hand,i get a NET::ERR_CERT_COMMON_NAME_INVALID .

In chrome,use F12,you get :
Certificate - missing
This site is missing a valid, trusted certificate (net::ERR_CERT_COMMON_NAME_INVALID).

My domain is:www.work-shine.com

I ran this command:
sudo certbot -nginx certonly

It produced this output:
/usr/lib/python3/dist-packages/ndg/httpsclient/subj_alt_name.py:22: UserWarning: Error importing pyasn1, subjectAltName check for SSL peer verification will be disabled. Import error is: No module named 'pyasn1’
warnings.warn(import_error_msg)
/usr/lib/python3/dist-packages/ndg/httpsclient/ssl_peer_verification.py:25: UserWarning: SubjectAltName support is disabled - check pyasn1 package installation to enable
warnings.warn(SUBJ_ALT_NAME_SUPPORT_MSG)
/usr/lib/python3/dist-packages/ndg/httpsclient/subj_alt_name.py:22: UserWarning: Error importing pyasn1, subjectAltName check for SSL peer verification will be disabled. Import error is: No module named 'pyasn1’
warnings.warn(import_error_msg)
usage:
certbot [SUBCOMMAND] [options] [-d DOMAIN] [-d DOMAIN] …

Certbot can obtain and install HTTPS/TLS/SSL certificates. By default,
it will attempt to use a webserver both for obtaining and installing the
certificate.
certbot: error: unrecognized arguments: –nginx

My web server is (include version):nginx/1.10.3 (Ubuntu)

The operating system my web server runs on is (include version):Ubuntu 16.04 x64

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don’t know):yes xshell5

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):

Hi,

If you are using certonly, I don't think you'll need --nginx (for running). (However I'm not sure)

Also the command should be --nginx (two "-" instead of one)

Thank you

Thanks for your reply,and it's helpful.The problem i want to solve is that when i try to visit my domain,i receive an error,and the error is NET::ERR_CERT_COMMON_NAME_INVALID.And i think i should re-edit my question.

Now it says “the certificate is only valid for work-shine.com”.

It’s worth noting that these are hosted on totally separate IP addresses:

work-shine.com has address 209.141.38.71
work-shine.com has address 107.161.23.204
work-shine.com has address 192.161.187.200
www.work-shine.com has address 45.76.234.229

You might want to figure out whether they’re meant to be hosted in the same place and in the same way, and which names should be included in your certificate.

Certbot chooses the names to request the certificate for based on existing nginx virtual hosts, if you use --nginx. You can request other names by giving a complete list of names with -d options. However, normally --nginx can only obtain certificates for names that are currently pointed at the server where you’re running Certbot. So, if www.work-shine.com and work-shine.com are pointed at separate servers, you wouldn’t be able to obtain certificates that cover both names by running certbot --nginx on a single server.

1 Like

Thanks for your help,and i now solved this problem.
I am new on build a sever or a website,and i usually make some stupid mistakes.
Hope for your tolerance.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.