Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cant connect Browsersync with DDEV nginx server, because SSL Error

I'm running DDEV nginx server on Bedrock wordpress site and trying to load snippet for Browsersync.

gulpfile.js browserSync task:

browserSync.init({
proxy: {
 target: "https://web.ddev.site"
}, 
https: {
 key: "/Users/user/Library/Application Support/mkcert/rootCA-key.pem",
 cert: "/Users/user/Library/Application Support/mkcert/rootCA.pem"
}, open:false}); 

Browser doesnt load snippet and print following error:

(index):505 GET https://web.ddev.site:3000/browser-sync/browser-sync-client.js?v=2.26.7 net::ERR_SSL_KEY_USAGE_INCOMPATIBLE

How can I get this two things to work together? Before DDEV I was using MAMP but DDEV has much better performance and I want to switch to this app. Thanks for help.

like image 848
hexcross Avatar asked Oct 16 '25 15:10

hexcross


1 Answers

The problem was bad ssl certificates file. It was necessary to use docker container certificate. Proxy option is not anymore required.

After setup ddev container, you need to copy docker certificate to some location:

docker cp ddev-router:/etc/nginx/certs ~/tmp

After that just update path to correct certificates files. My gulpfile task now looks like this:

browserSync.init({https: {
 key: "/Users/username/tmp/master.key",
 cert: "/Users/username/tmp/master.crt"
}, open:false});

Thanks @rfay for solution!

like image 131
hexcross Avatar answered Oct 18 '25 13:10

hexcross



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!