# Need to generate cert for Windows Xampp install

Hi, I’m new to Linux and want to use Ubuntu to generate a cert for a Windows Xampp install since I have found no simple way to do it on Windows.

I installed LE from Github, and get “Command not found” when running the letsencrypt command. I believe the documentation shouldn’t be using the environment variable “letsencrypt”, off the bat if it doesn’t work without extra configuration. Instructions, or a caveat might help. I read somewhere to create an alias but that confused me since I’m new to Linux, and not great with its file system.

In any case, I successfully ran the script from the lets encrypt folder like another user pointed out on the forum. The arguments I ran are as follows (from the Get Started page}:

To obtain a cert using the “webroot” plugin, which can work with the
webroot directory of any webserver software:

./letsencrypt-auto certonly --webroot -w /var/www/example -d example.com -d www.example.com

I used this since I’m going to move the files to Windows Xampp. I don’t know what “thing” is, but assume I don’t need it.

The script seems to run. Then returns without notification of success or failure. Navigating to /var/www/example and there are no files there.

What am I doing wrong? Should I not be using webroot? I just want the cert and key file.

The correct command to run from a git installation would be ./letsencrypt-auto, from within the directory to which you cloned the client. Or, with your example:

./letsencrypt-auto certonly --webroot -w /var/www/example -d example.com -d www.example.com


Basically, anywhere you see letsencrypt in the documentation, that’s ./letsencrypt-auto in your case. The documentation is not quite consistent with that, admittedly.

Yeah, so I got that far. Any idea why the script terminates without notification?

Sorry, I thought that was for running letsencrypt, not ./letsencrypt-auto.

Is there a log file in /var/log/letsencrypt/letsencrypt.log? If so, maybe that’ll point you towards the problem, or otherwise just paste it here. (You can use cat filename to view the file)

OK I will check. My Linux machine is at work. But I’ll get back to you when I’m in. Thanks for the help. I edited my original post to be more clear. Also, what is thing.is in relation to my domain?

XAMPP includes PHP, so you could use my PHP client which works on Windows.
https://github.com/kelunik/acme-client

That way you don’t have to go through the complicated way of using a Ubuntu VM to issue and renew your certificate.

2 Likes

If it did work, the files it obtained would be in /etc/letsencrypt rather than in /var/www/example (the private key is a secret and shouldn't be in the public www directory, which contains files that are served by your web server as web site content, not configuration for the web server itself). But when it succeeds it normally does show a message to say so, so I agree that it would be helpful to see the client log file.

I did see this, but it wasn’t clear to me how to use it. I’ll have to have another go.

There is an installation and usage section. If anything is still unclear, just open an issue there or ping me here.

Thanks for the kind offer. So what do I do? I have the .phar. Do I put it in htdocs dir and browse to it?

The instructions just say

Run it.
./acme-client.phar

What does this mean? Run it from where?

The command line. As long as you have php in your path that should work. Otherwise you can use php C:\path\to\acme-client.phar

Ok it makes a little more sense and I have the client running. Do I use the syntax from letsencrypt or the arguments as defined in the client?

Using the simpler client arguments I’m getting an MX record error. I use cloudflare and have an MX record pointing to mail.mysite.com, which is an A record and at another server than my website. Does that matter?

So to clarify, my web server is at a different ip than my mail host. I can receive emails at the address I am using.

Edit: I found this: How to get a Let’s Encrypt certificate while using CloudFlare but it seems I have to use the arguments that the PHP client is expecting. I moved on from setup to “issue” now I get an error that my domain can’t be resolved to an IP4 record. Could this be that my router doesn’t have loopback? Internally I am using my hosts file.

If I get it right, your mail host has a CNAME / DNAME record, right? I might ignore CNAMEs / DNAMEs during lookups for MX records. Could you share your domain name? You can use a private message for that, too.

You have to use the arguments as shown when you use the -h option, so acme-client setup -h for example.

How do I PM you? Maybe I can’t because I’m a new user. When I go to your profile I don’t see an option. I must be taking crazy pills. lol. Thanks again for the help. Edit: Was bumped to be able to message my a mod. PM’d you.

You can check ACMESharp Its a LetsEncrypt Client and can run in Windows. The project author is developing a CLI interface for it.

Hi, so I eventually got this to work. I had my firewall alerts switched off so PHP was being blocked outbound silently. Secondly, my router doesn’t have a loopback interface. I have a hosts file redirect to localhost for the domain, but it was disabled from previous troubleshooting. I thought maybe the LetsEncrypt server did the check, but I guess the host name needs to resolve for the client too:) Thanks again for the help.

That reminds me, I'm curious about MS's up coming bash implementation. Apparently it's going to be the Ubuntu version of bash (literally, not a MS port), so I'm wondering whether @Neilpang's bash client (and others) will work exactly like it does on *nix.

My server is FreeBSD, but I'd used bash on linux since 1994 so when I switched to FreeBSD in 2004, I installed bash for the familiarity (damn you, shellshock!). I use Windows on my desktop/laptop/HTPC, and if bash in Windows works as advertised, I can almost see myself completely replacing my use of cmd with bash going forward. The consistency across systems will be wonderful. (Powershell is great and all, but I could never quite get used to scripting for it. Get off my lawn.)

Yes, My client le.sh already tested on Windows 10 Ubuntu subsystem :
Le.sh runs on Windows 10 Linux Subsystem(aka Ubuntu on Windows 10)

Thanks for confirming @Neilpang. Since the official client works well for me, I’m not following the development of other clients as rigorously as I should

You told the forum’s almost a week ago! I’m so blind…

How to install it in windows? I want to use it with Nginx/Apache

Windows does not run Linux Commands i’ve few linux command thanks to GIT Preview