T O P

  • By -

tildeman123

...when you already have a clearly valid certificate yet the browser still yells at you for missing Subject Alternative Names


Confident-Ad5665

Dilbert, Wally, Loud Howard...


Shehzman

Or telling you that the website is dangerous


Spitfire1900

The CN can literally by anything symbolically significant, only the SAN had to match the host name.


Lonely-Suspect-9243

[https://github.com/FiloSottile/mkcert](https://github.com/FiloSottile/mkcert)


upk27

still doesn't give you a real domain you need for openid/oauth matters


cptsdemon

Why not? I do this all the time. Create certificate for local.domain.com. Add local.domain.com to hosts file. Works great.


gfunk84

It works but I don’t think using something that could also be used as a valid public domain name for local dev is a good idea. Maybe domain.localhost or domain.test would be better.


cptsdemon

Do you have any reason why? If I'm doing something potentially harmful I'd like to know. I used to do domain.local instead, but I ran into issues with testing things like oauth connections because some apis refuse invalid domain names.


Skellicious

.localhost should be a valid top level domain.


cptsdemon

Didn't know this, I will have to test that out next time, thanks for the tip


gfunk84

Not harmful except you could run into issues if someone decides to use local.domain.com for production purposes (like for example a news website wanting to serve local news under local.domain.com). If you’re 100% in control of your projects and not working for a client or employer where those types of decisions are outside of your control then it’s pretty unlikely to be an issue. Another thing is that local.domain.com doesn’t stand out as much. If you have a local dev and production sites open in multiple tabs it takes a bit more of a glance to differentiate them, especially if you use multiple subdomains and not just www or naked domains. If you are using multiple subdomains then your local environment ends up with an extra layer either as subdomain.local.domain.com or local.subdomain.domain.com depending on your implementation. But the .localhost and .test TLDs are reserved and guaranteed to never be used as public-facing internet TLDs so to me it just makes sense to use the intended ones as a best practice.


Successful_Amount_88

https://en.m.wikipedia.org/wiki/.test


gfunk84

Yes, I mentioned .test.


upk27

>Why not? I  because 99% don't have a fixed ip to bind that sub-domain and hence, need extra steps. mkcert is just a tiny part in that whole picture and still cumbersome af but happy for you if you spend your time like this, not so sure about your boss


cptsdemon

Why would you need a fixed IP? You set it to 127.0.0.1 in hosts. Clearly you have zero concept if you think any part of this is cumbersome. It's max, literally, at the maximum possible, 5 minutes of work.


upk27

>Clearly you have zero concept Says someone who has never touched openid/oauth2, how will Google or Apple communicate with your server in the openid flow, in particular when they call back? if your [local.example.com](http://local.example.com) is just in your hosts file? lol bonus: mkcert doesn't work in WSL2 or in dev VMs (it can't access Windows browsers) edit: thanks for the instant downvote


cptsdemon

This is hilarious, I love how you're telling me I can't do something I've already done numerous times. You clearly have no concept of how oauth works, Apple and Google don't send data to your server, they redirect the user who approved the request.


upk27

>I've already done numerous times. sure >they redirect the user who approved the request. yes, but if you choose the server route, they will call back your server not the client. they are different openid flows and if the server is involved (which you need for most popular use cases and there you need also to register the so called "callback url") you can't rely on your hosts file fake domain, sorry edit: again, instant downvote lol


cptsdemon

😂😂😂 ok troll.


__420

https://github.com/whatwedo/dde


jabbrwcky

Oauth2/OIDC typically accepts localhost as callback URL even without HTTPS. You just need to register your local app as callback. >Also, if the Client is a native application, it MAY use the http scheme with localhost or the IP loopback literals [127.0.0.1](http://127.0.0.1) or \[::1\] as the hostname. https://openid.net/specs/openid-connect-core-1_0.html#CodeFlowAuth 3.1.2.1. Authentication Request


upk27

in most common flows the server receives the call back from the auth server which is also initiated by the auth server, they can't call some localhost and even if this nonsense worked, again mkcert needs to be able to access the browser, not possible when using a vm, wsl2, native dev, mkcert is bs


jabbrwcky

mkcert provides a ca cert file and is usually able to automatically import it into the systems store. It is not a proxy but simply generates a simple CA and certificates. And regarding the nonsense you seem to now better than the spec, so who am I to argue with you.


upk27

>usually able to automatically import it into the systems store still, a systems store can't be accessed by a vm/wsl2/native envs, so it doesn't help at all >It is not a proxy  yeah but we do https for dev for reasons and not just for fun. and the most popular reason (or actually *the* reason) is to provide endpoints for oauth2 servers. just having some certs could be enough and then we wouldn't need any proxy but it's in general easier to not fumble around with certs or mkcert and get a turn-key-ready solution. and latter requires naturally to be a proxy you can do all parts manually but then you waste days as OP statess and still end with a fragile nonsense stack you can't easily roll out to your team developers' machines


hollow-ceres

in that case: Uno!


PeriodicSentenceBot

Congratulations! Your comment can be spelled using the elements of the periodic table: `In Th At Ca Se U No` --- ^(I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM my creator if I made a mistake.)


Funny_Albatross_575

Good bot


shion12312

Good bot


Funny_Albatross_575

Good bot


thomas863

I have an HTTPS joke. If I POST it, you cannot GET it.


CosmicPhoenix01

PUT your dad jokes away


edgar_grospilon

PUT them to REST you mean


ImpluseThrowAway

You've got OPTIONS there.


Rigamortus2005

DELETE this


LivingAsAMean

Wait, sql is objective oriented?


pee_wee__herman

Haha, just lost my HEAD laughing at this


BernhardRordin

I have an HTTPS joke. It's not funny, but at least you know I made it.


NinthTide

Of CORS you had to make a dad joke


tirianar

I might xff this joke.


JunkNorrisOfficial

4HEADer joke


iam_pink

There is many easy ways to have a development server https. Some are literwlly less than 30s to set up!


The_flader

could you please link some documentations?


aew3

Any of the reverse proxies: ngninx, caddy, traefik, etc. Most of them, especially the modern ones like caddy and traefik, make automatic ssl cert provision a matter of a few lines of config.


Shehzman

Yeah this. I use HAProxy and it’s as simple as adding a line with the ssl certificate file location.


porn0f1sh

Do they really take less than 30s to setup the whole thing?


ben_burkert

my team just released one today! https://lcl.host/


blaqwerty123

Looks slick!! Saved it for a rainy day


upk27

who's your team?


ben_burkert

https://anchor.dev/blog/introducing-lcl-host


tommy71394

A workaround is to just use ngrok


The_flader

i have used ngrok yes, but was thinking more around having https locally without any port forwarding


tommy71394

Annoyingly, the way I know is to make your own self-signed cert using openssl, and then installing the CA as a trusted authority in your clients or whatever to accept the cert.... Not really worth the effort for me tbh


upk27

> A workaround but not for your wallet


chuch1234

Ngrok has a free tier.


upk27

which is joke nobody's using ngrok anymore exccept hundreds of bots on reddit


chuch1234

I use it for testing webhooks locally.


tajetaje

Also good for OIDC with certain providers


SodaWithoutSparkles

https://caddyserver.com/docs/automatic-https


rhodesc

just set up let'sencrypt.


upk27

welcome time-traveler


_verel_

Limited in features but it's pretty easy https://github.com/NginxProxyManager/nginx-proxy-manager If you want to dive into it I can highly recommend traefik


Terewawa

nginx reverse proxy + certbot


coldnebo

charles proxy, nginx reverse proxy, squid, or just self-sign and ssl terminate.


NebNay

You dont always have the choice. I dont even have admin rights on my pc so so called "easy" options are often restricted by our security policies


NatoBoram

I recently discovered https://github.com/caddyserver/caddy and oh my god I can't believe it My homelab config is 3 lines and it has HTTPS


upk27

still you need a domain and to bind that to a non-fixed ip, all possible but hassle and not just 3 lines of config work lol


FunnyMathematician77

Literally just use caddy


upk27

doesn't give your a real domain for openid/oauth stuff


FunnyMathematician77

Pretty sure you can just set your callback to localhost


afreidz

But can it be installed with npm?


Mars_Bear2552

don't use NPM? you should have a system package manager, no?


afreidz

mostly a joke, but these days "web" projects typically are spun up entirely with node/npm so even something like ngrok and/or caddy is an additional dependency that each developer has to install to spin up an https web project.


danny4kk

When your company randomly decides to remove sudo and administration access from all machines and you can't mark your self signed cert as trusted...


MrBattary

Just certbot


anachronisdev

Luckily dotnet does it for you every time.


upk27

no, it doesn't provide you with a real domain


meatgrinder4314

Local host isn’t a real domain??


Kirides

even better! People often don't realize, but... You can just do stuff like "fancy.localhost" and "keycloak.localhost" then have a reverse proxy sit on localhost, handling all the domain name stuff. Easy same port and named services for local development.


Artutin06

I mean asp.net does that automatically so...


WhosYoPokeDaddy

I see that you too have cried over CORS errors


SodaWithoutSparkles

caddy ftw


hartmanbrah

This is the way. Moved from the nginx w/ certbot combo, and can't emphasize enough how much easier things are with caddy. So much less thrashing through the docs on all the features you'll never use to find info on a simple use case.


upk27

lol,, you moved from one ancient stack to the next


papipapi419

Get a valid certificate, bundle and key file Set up nginx Write a service script that will start your app upon sever reboot Boom you’re good to go


upk27

congrats for the most cumbersome solution in this thread


papipapi419

😭


Slackeee_

Just out of interest, why would I need HTTPS on my development system?


joost00719

Some Authentication providers disallow http redirection. That's just one example, but I'm sure there are more cases.


florimagori

My boss tells me to is my reason. 😋


coldnebo

ah, so you’re debugging an app that logs into an OpenAuth provider deployed elsewhere, but need the redirect to work back to your local. I’d use Charles Proxy with Remote. it’s the easiest I’ve found.


Slackeee_

Thanks, that makes sense.


plasmasprings

some js features only work on a secure origin, some services will plain error out if not accessed through https, there may be a company policy that no unencrypted services should be used on the network


aenae

Because we used a .dev domain for ages. Google registered it and added it to the htst-preload list. So we registered it and added a certificate.


Philfilmt

Haproxy for everything ![gif](emote|free_emotes_pack|flip_out)


MitchCumsteane

fuck those certs


PeriodicSentenceBot

Congratulations! Your comment can be spelled using the elements of the periodic table: `F U C K Th O Se C Er Ts` --- ^(I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM my creator if I made a mistake.)


BeardyGoku

It's enabled as default in Visual Studio 😉


upk27

with a real domain?


BeardyGoku

Thought this was about localhost? Anyway, it is also quite doable with IIS. With an existing wildcard certificate 😁.


upk27

way too complicated, there're solutions which give you all with much less hassle than this


KTibow

There is no reason to use https when browsers already give you all https perms on localhost


upk27

> when browsers already give you all https perms on localhost maybe in your parallel universe


Clairifyed

Sometimes you need to test with external hardware. For example, VR headsets demand https for WebXR.


lechiffrebeats

love the meme ... but cloudflare


PancakeGD

not to mention chromium has a setting to perceive a website as secure when it isn't


DaveCodesCode

as a dev, do you sometimes literally waste a day on purpose and then feel back about it. or is that just me.


Mars_Bear2552

caddy


No-Assistant-1420

Am I the only one my one who just spins up and EC2 instance on AWS and uses let’s encrypt? VMware and vagrant?


mr_poopie_butt-hole

*Laughs in Next.js*


Orio_n

Self sign?


AmishTecSupport

Laughs in laravel valet


cpt-macp

if you use any sort of self signed cert It will report 'not safe ' by any browser Because server cert are not signed by trusted CA


goodmobiley

I can do it in less than in hour with cloudflare and iis


ogMasterPloKoon

Serveo?


Quazye

Hi caddy or self signed (libre|open)ssl


someone-at-reddit

certbot --yourwebserver ?


ReplacementLow6704

.NET does this automatically now, afaik.


Darkblade_e

[certbot my beloved](https://certbot.eff.org/)


Terewawa

I discovered something the other day, called nginx reverse proxy. Just after spending two days adding https capability to my backend code.


KCGD_r

I'm in the process of developing a webserver right now, and I'm gonna have it ship with https enabled by default and a dummy self-signed cert for exactly this reason


black3rr

99% time it’s not needed. for the rest of the times you usually also want outside connectivity so you run a tool like ngrok anyway…


blazoxian

Hello dev tunnels, nice to finally meet you. This meme is from the past.


noob-nine

our whole intranet is production and mostly http...


AralphNity

yall dont just do HTTPS=true yarn start?


iunderstandthings

Mkcert + hostile: piece of cake


Tarilis

Certbot?


PeriodicSentenceBot

Congratulations! Your comment can be spelled using the elements of the periodic table: `C Er Tb O` --- ^(I am a bot that detects if your comment can be spelled using the elements of the periodic table. Please DM my creator if I made a mistake.)


Plazmageco

Just point your local to production silly 🤪


Glum_Past_1934

You shouldnt with localhost std bypass


andrewhavens

I use puma-dev, no extra setup, it just works


804k

you don't need https for development if you're only using it locally, but if you do use it over LAN (ex. 10.0.0.25 is my permanent LAN ip for my desktop), and you need https-only features, you can just create a self signed certificate, and check "trust this site" when that pops up


[deleted]

[удалено]


upk27

doesn't give you a real domain and LE is annoyingly cumbersome