polypush135

polypush135

I’m creating a white label site for elixir user groups.
https://github.com/PDX-Elixir-Group/elixir.group

One of the main ideas is that I want to subdomain each user group. ie: I own elixir.group and I want to setup a group as pdx.elixir.group

I’ve been able to successfully setup self signed certs for just a single domain locally via mix phx.gen.cert which fyi is awesome ! but I’m having a hard time trying to get a wildcard cert working. Any pointers?

Has anyone else been able to successfully do this locally?

Showing Posts 1 to 5

voltone

voltone

It works for me:

$ mix phx.new wildcard --no-ecto --no-webpack
* creating wildcard/config/config.exs
* creating wildcard/config/dev.exs
[...snip...]
$ cd wildcard
$ mix phx.gen.cert localhost "*.localhost"
* creating priv/cert/selfsigned_key.pem
* creating priv/cert/selfsigned.pem
[..snip...]
$ vim config/dev.exs
# Edit as instructed
$ sudo vim /etc/hosts
# Add localhost subdomain
$ head -1 /etc/hosts
127.0.0.1 localhost localhost.localdomain test.localhost
$ iex -S mix phx.server
Erlang/OTP 21 [erts-10.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]

[info] Running NewV140Web.Endpoint with cowboy 2.6.0 at https://localhost:4001
[info] Running NewV140Web.Endpoint with cowboy 2.6.0 at https://localhost:4001
Interactive Elixir (1.7.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> 

Opening https://localhost:4001/ and https://test.localhost:4001/ works in both Chrome and Firefox. Of course I need to confirm trusting the self-signed cert, but that’s expected.

Can you please clarify what’s not working for you?

polypush135

polypush135 OP

You should try to trust the cert and see if its still working for you.

Also I don’t think you need to update the ect/host file to get subdomains working.

polypush135

polypush135 OP

Also I can confirm that the primary domain does end up working with the cert but for some reason *.localhost does not seem to be enough for the subdomains to work.

voltone

voltone

When I say it works, I mean this: when I click through the browser’s warning screen, the site loads, I can navigate the site, page assets load, AJAX requests and websocket connections work, and secure cookies work as expected. This is what I need for local testing.

I fully expect the browser to continue to show the site as ‘not secure’. The fact that I approved a certificate exception does not mean it is now safe to submit credit card details or important credentials. This is really for testing purposes only.

Now, Chrome has this flag to ‘accept self-signed certificates on localhost’. Perhaps this prevents the security popup or the ‘Not secure’ indication. But I guess that feature only applies to the ‘localhost’ domain itself. Anyway, that’s a Chrome feature, it has nothing to do with the contents of the certificate.

polypush135

polypush135 OP

As you can see in my later screen shot I’ve already approved the certs and have set the flag in chrome. I have also tried this in other browsers too with no luck.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews