WSL, SSL, Certs for xenforo.dev?

Robert9

Well-known member
For the past two days, I have been trying to get Apache under WSL and Firefox to communicate with each other. Unfortunately, Firefox does not accept my certificate, and the selected exceptions are simply ignored. Does anyone have an Ubuntu setup on WSL as a test environment with SSL configured? Does anyone have a non-existent domain like xenforo.dev? Has anyone managed to teach this annoying Firefox or other browsers that they would like to see this site? Do I have to work without SSL to have a testing environment? Do I need a real domain to get a real certificate? This is sooooo frustrating, incredibly so. Two days of interaction with AI, which is at the same time smarter than I am and, at the same time, dumber than any dog.
 
Does anyone have an Ubuntu setup on WSL as a test environment with SSL configured?
Various Debian with Apache and nginx but not WSL (VMs with VirtualBox for historic reasons).

Does anyone have a non-existent domain like xenforo.dev?
I use dev.local, but that domain does exist (ony my system)

Has anyone managed to teach this annoying Firefox or other browsers that they would like to see this site?
Yes.

Do I have to work without SSL to have a testing environment?
No.

Do I need a real domain to get a real certificate?
What is a real domain?
Best option is to have a domain with a valid certificate, probably the easiest way:
 
Thank you.

A real domain is like a real Linux?

Without SSL, it's not a big deal, except when there's an error and Firefox can't find a webpage. In that case, it switches to "I rule the world" mode and stubbornly refuses to switch from https to http. Clearing the cache and history doesn't help, nor do various about:config settings. I then have to switch from xenforo.dev to xanfara.dev or something similar for the browser to work again.

https://xenforo.dev is reachable here via curl from WSL and also via Invoke-WebRequest from Windows. Only the browser is being a spoil-sport.

What environments are the developers of Firefox actually working with at this place?

Anyway - I give up. The empty XenForo is now back under localhost; if I need another, directories will be renamed. And yet it’s unbelievable that these clowns can’t manage this in 2024, despite offering all sorts of exceptions in the config that seemingly don’t work.
 
Last edited:
You can't get a 'real' SSL cert for a domain you don't own.

edit: You could create your own SSL chain and set your personal computer(s) to trust it, but is it really worth all that for a dev domain?
 
Honestly, I don't care whether it's real, mystical, imaginary, or just for building an intergalactic bypass. I find it, to put it mildly, disgusting that I can't tell my browser: "Attention, here is a super-duper-90-million-bit encrypted certificate for the domain countryroad.gugu, and when I access this domain, let me through, or you'll be shot!"

When you open Firefox, there are various options for custom certificates, servers, exceptions, etc., but none of it works, at least not for me, and not for many other people who are searching for solutions online. But maybe there's a solution above. I will certainly want to try it out soon.
 
But maybe one should use the domain they have on the internet at home as well, and work with home.domain.com and a real certificate. That it's such a drama with Firefox still pisses me off; I could have spent the last two days picking my nose instead.
 
I once tried to get a dev environment set up on Windows using WSL. It was a frustrating experience.

My strong recommendation these days is to use a free Laravel product called Herd.

It’s available for both Windows and macOS and natively runs the dev environment with very little complexity. Think of it as a much more modern and stable WAMP.

It doesn’t include MySQL for free but you can just download and install that on Windows directly from MariaDB.

For each site that you set up it creates a fully working certificate using a .test domain.

You can easily switch between multiple PHP versions on a per-site basis.
 
Honestly, I don't care whether it's real, mystical, imaginary, or just for building an intergalactic bypass. I find it, to put it mildly, disgusting that I can't tell my browser: "Attention, here is a super-duper-90-million-bit encrypted certificate for the domain countryroad.gugu, and when I access this domain, let me through, or you'll be shot!"

When you open Firefox, there are various options for custom certificates, servers, exceptions, etc., but none of it works, at least not for me, and not for many other people who are searching for solutions online. But maybe there's a solution above. I will certainly want to try it out soon.
You absolutely can, as I suggested in my post. However, the LOE is high and I hope you can see that its for a good reason. If it were easy to spoof domains and SSL certificates, it would be very easy for folks to do nefarious things.
 
I once tried to get a dev environment set up on Windows using WSL. It was a frustrating experience.

My strong recommendation these days is to use a free Laravel product called Herd.

It’s available for both Windows and macOS and natively runs the dev environment with very little complexity. Think of it as a much more modern and stable WAMP.

It doesn’t include MySQL for free but you can just download and install that on Windows directly from MariaDB.

For each site that you set up it creates a fully working certificate using a .test domain.

You can easily switch between multiple PHP versions on a per-site basis.
I've been having to look into Docker / something like Herd just for XenForo development work as for some odd reason I can't successfully get more than one version of PHP running with Homebrew. I can get any version going but then if I start up another, one of them (at random) will error out and not run. May be an arm issue but eh I'm not excited to try and find the solution to allow me just to do it the normal way.

I have gotten local custom domains with ssl working though thanks to Valet from Laravel. I'll most likely end up just switching to Herd for XF only.
 
Last edited:
It's incredible what a little programming entails; WSL, Xdebug, and Storm! Hooray, it's working, but that was just the beginning. Because to automatically create a javascript.min.js from javascript.js, you need Node, but no, not on Windows, on WSL! Or Docker. Or a miracle?

And so it goes on and on. People who do this professionally must all have photographic memories or sit at their computers for 23.5 out of 24 hours? Still, I'm having fun. And after reviewing various addons and 24 hours of tinkering, I finally have a copy button that works under 2.3. And that's only because I really wanted it.

There are so many more important buttons missing in Xenforo; let's see if I can create another one tonight that will probably save me about 30 hours of clicks and time each year. Call me the Click Avoider!
 
Because to automatically create a javascript.min.js from javascript.js, you need Node
I am not 100% sure if you are talking about XenForo Add-on build process as XenForo does not necessarily require Node to create minified JS, closure compiler is also available as a Java version or precompiled binary for Linux, Windows and MacOS.

Using the binary is IMHO the easiest option.
 
I once tried to get a dev environment set up on Windows using WSL. It was a frustrating experience.

My strong recommendation these days is to use a free Laravel product called Herd.

It’s available for both Windows and macOS and natively runs the dev environment with very little complexity. Think of it as a much more modern and stable WAMP.

It doesn’t include MySQL for free but you can just download and install that on Windows directly from MariaDB.

For each site that you set up it creates a fully working certificate using a .test domain.

You can easily switch between multiple PHP versions on a per-site basis.
Sorry for the reply later on, but is there anything special any of y'all use on the team for better log views like how herd pro has? That's the only feature I want from Pro but I don't want to spend $99 for one feature lol.

Edit: I lied the mail feature also looks nice but still that's only 2 of em.
Edit Edit: Ohhhhh Mailpit looks nice. I can probably find an alternative to the logging as well. Wasn't really impressed with what I read by the main backer of Herd so probably won't ever buy it. Especially since they hide that the $99 price tag is an annual fee and you have to find that information in the FAQ.

It's incredible what a little programming entails; WSL, Xdebug, and Storm! Hooray, it's working, but that was just the beginning. Because to automatically create a javascript.min.js from javascript.js, you need Node, but no, not on Windows, on WSL! Or Docker. Or a miracle?

And so it goes on and on. People who do this professionally must all have photographic memories or sit at their computers for 23.5 out of 24 hours? Still, I'm having fun. And after reviewing various addons and 24 hours of tinkering, I finally have a copy button that works under 2.3. And that's only because I really wanted it.

There are so many more important buttons missing in Xenforo; let's see if I can create another one tonight that will probably save me about 30 hours of clicks and time each year. Call me the Click Avoider!
Can't lie I do spend a lot of my time at my computer(s). Day job is software engineering, then I do my own side stuff which includes XenForo addons now and various other projects (Ruby on Rails apps, spa apps with astro/next/react, and currently also tinkering with Rust) and also game way too much.
Edit: Oh also @Robert9 I tend to not develop on Windows to make it easier. Yeah WSL2 is nice but I'd rather just stick on my Mac Studio or Pop_OS! work laptop.
 
Last edited:
I'm now very satisfied with everything; Windows 11 doesn’t bother me at all anymore—I’ve simply forgotten that life was different just a week ago. WSL2 runs wonderfully once it’s started, and PHPStorm works great with Xdebug, especially since I have a script that automatically inserts the IPs from WSL and Windows wherever they belong.

I once had a Mac for four weeks—probably great if you grew up with it, but I wouldn’t switch for any amount of money. Too unfamiliar, and other reasons that don't belong here.

I used to have Windows and Linux on two separate computers, but now both are on the same drive, eliminating the need for constant uploads. That’s really nice.

What’s still missing?

Hello Eizo, please make me a color-accurate square monitor with 2560 by 2560 pixels! It’s completely nonsensical to have to turn my head left and right but not be able to move it up and down! My screen is always too short! My eyes would mostly be on 1280x1280, and I could move my head them in all four or even eight directions.

Why hasn’t anyone realized this and made it happen yet?
 
Last edited:
There is one thing I miss:

Hello PHPStorm, when I save an XML, then tell XenForo with PHP CMD to rebuild only the templates.

Can we rebuild templates only?
 
I did use the square Eizo for some time even bought two of those. It wasn’t a bad setup. But it’s just 1920x1920 pixel. Eizo does not sell the square one any more I guess.
 
es, I also considered that one, but I didn’t buy it. Instead, I went with the 5:4 monitor, but you absolutely cannot place it next to a 2K screen because the pixel density is drastically different.

I forwarded my text above to Eizo, as I was already in conversation with someone there. Perhaps they might come up with the idea that a programmer's monitor would be a nice thing. But maybe they prefer to sell two monitors side by side.

On a completely different note, don’t we have a template rebuild?
 
You can list commands via php cmd.php list. There is a xf-dev:import-templates command, but it imports them from _output/. Manually messing around with XML files is not typically necessary during add-on development.
 
I'm basically developing my addons on a live system; every small change to the templates requires a rebuild, which is really annoying.

I could, of course, edit the templates directly within XenForo, save them each time, and when I'm done, copy everything back into my XML. Yeah, that would probably be smarter if you consistently keep track of what you're doing and what you've changed.

I like tweaking things directly in PHPStorm because it’s much nicer to work there than in a browser window, but at the end, I still end up pressing the rebuild shortcut 43 times anyway.

I'm going to change this starting today. But if you ever get bored, maybe you could build a rebuild-template feature so that I can connect it to PHPStorm, so that it happens automatically every time an XML file or specific XML files are saved. That would be pretty cool, I think.
 
a) work in browser window, save, check result
b) work in PHPStorm, save, console rebuild, check result.
c) work in PHPStorm, copy code to browser window, save, check result


better would be:

d) work in PHPStorm, save => automatically rebuild xml, check result

or best

e) open one template in PHPStorm, save it, check result


Every window switch, every click, every keystroke is one too many!
 
You can already edit templates directly in PhpStorm without using the XML, and they will be auto-updated whenever they are rendered. The XML is only really relevant for building the add-on, and will pick up the updates during the next build.
 
Back
Top Bottom