How to enable HTTPS for local development in macOS using Chrome

HTTPS, macOS, Chrome

local HTTPS

https://www.cnblogs.com/xgqfrms/p/13582130.html

localhost & HTTPS

  1. 隐藏警告

  1. 修改证书

拖拽 icon

localhost.cer

Quit keychains, 刷新 Chrome

生成证书

key , cert 有效期

keytmp.pem

cert.pem

key.pem

$ openssl req -x509 -newkey rsa:2048 -keyout keytmp.pem -out cert.pem -days 365
# 123456 $ openssl rsa -in keytmp.pem -out key.pem

React 17 & SSR

{
"start": "HTTPS=true react-scripts start"
}
{
"start": "export HTTPS=true && SSL_CRT_FILE=cert.pem && SSL_KEY_FILE=key.pem react-scripts start",
}

demo

https://github.com/xgqfrms/react-in-depth/tree/master/https-app

key & cert

https://github.com/xgqfrms/react-in-depth/blob/master/https-app/cert.pem

https://github.com/xgqfrms/react-in-depth/blob/master/https-app/key.pem

https://github.com/xgqfrms/react-in-depth/blob/master/https-app/package.json


{
"name": "https-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-scripts": "3.4.3"
},
"scripts": {
"dev": "react-scripts start",
"start": "export HTTPS=true && SSL_CRT_FILE=cert.pem && SSL_KEY_FILE=key.pem react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

refs

https://flaviocopes.com/react-how-to-configure-https-localhost/

https://flaviocopes.com/macos-install-ssl-local/

https://www.freecodecamp.org/news/how-to-get-https-working-on-your-local-development-environment-in-5-minutes-7af615770eec/

https://medium.com/@jonsamp/how-to-set-up-https-on-localhost-for-macos-b597bcf935ee

https://dev.to/tability/local-development-with-https-on-osx-1jpb

https://stackoverflow.com/questions/59080466/how-do-i-fix-my-ssl-configuration-for-local-development-with-apache



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


How to enable HTTPS for local development in macOS using Chrome的更多相关文章

  1. Enable HTTPS in Spring Boot

    Spring-boot-enable-ssl Enable HTTPS in Spring Boot APRIL 14, 2015DRISS AMRI This weekend I answered ...

  2. How do I copy SQL Azure database to my local development server?(如何将Azure 中的数据库备份到本地)

    Now you can use the SQL Server Managerment Studio to do this: Connect to the SQL Azure database. 通过 ...

  3. HTTPS页面使用CNZZ统计代码,Chrome显示警告怎么办?

    很多站长会遇到一个问题,网站加入CNZZ的JS统计代码后,Chrome浏览器出现警告:阻止跨站解析器阻断脚本通过document.write调用(A parser-blocking, cross si ...

  4. macOS下Chrome和Safari导入证实抓包HTTPS

    目录 下载证书 mac OS导入证书 Chrome设置代理 Safari设置代理 下面的操作基于Mac OS Catalina(v10.15.3),抓包拦截工具基于Burp Suite v2.1.05 ...

  5. browser-sync & http server

    browser-sync & http server browser-sync https://www.browsersync.io/ usage # step 1 $ npm install ...

  6. 接口测试之——Charles抓包及常见问题解决(转载自https://www.jianshu.com/p/831c0114179f)

    简介 Charles其实是一款代理服务器,通过成为电脑或者浏览器的代理,然后截取请求和请求结果达到分析抓包的目的.该软件是用Java写的,能够在Windows,Mac,Linux上使用,安装Charl ...

  7. Implementing HTTPS Everywhere in ASP.Net MVC application.

    Implementing HTTPS Everywhere in ASP.Net MVC application. HTTPS everywhere is a common theme of the ...

  8. TroubleShoot: Enable Developer Mode in Windows 10 Insider Preview Build 10074

    There is a known issue in Windows 10 Insider Preview build 10074 (see here). Developers cannot enabl ...

  9. 5分钟上手:本地开发环境启动HTTPS

    今天我们访问的所有网站几乎都是受HTTPS保护的.如果你的站点还没有,那你应该使用它.使用HTTPS保护服务器也意味着你不能从不是HTTPS服务器向此服务器发送请求.这给使用本地开发环境的开发人员带来 ...

随机推荐

  1. django模板中导入js、css等静态文件

    打开settings.py,在底部添加: import os STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(os.path.dir ...

  2. Jmeter如何录制APP客户端脚本

    简单五步教大家Jmeter录制APP客户端脚本: Step1 右键单击该测试计划,选择"添加"-"线程组",添加一个线程组. Step2 为了录制客户端的操作, ...

  3. rehash (重新散列)

    rehash - Redis 设计与实现 http://redisbook.com/preview/dict/rehashing.html

  4. linux 文件结构体和文件描述符号的学习

    https://blog.csdn.net/cywosp/article/details/38965239

  5. docker基本使用-常用命令

    一. 常用命令 #查看docker服务 docker ps #启动docker服务 systemctl start docker #查看本地镜像 docker images #删除本地镜像 docke ...

  6. JavaScript——DOM操作

    DOM-(Document Object Model)即文档对象模型. JavaScript可以动态地修改DOM,从而来修改HTML的内容. 查找HTML元素 通过 id 找到 HTML 元素 通过标 ...

  7. Hive基于MapReduce运行过程

    原文链接https://www.cnblogs.com/felixzh/p/8604188.html Map阶段包括: 第一读数据:从HDFS读取数据 1.问题:读取数据产生多少个Mapper? Ma ...

  8. Spring boot 异步线程池

    package com.loan.msg.config; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandle ...

  9. 8.Cisco DHCP中继详解

    1.网络中的终端通过发送DHCP广播的方式来获取IP地址信息.由于VLAN隔离广播,当终端与DHCP服务器不在同一广播域时,就需要用到DHCP中继. 2.DHCP服务的原理概述: DHCP服务器想要给 ...

  10. 1.二层常用技术-STP

    1.STP定义: STP(Spanning Tree Protocol)是生成树协议的英文缩写.STP在IEEE 802.1D文档中定义,该协议的原理是按照树的结构来构造网络拓扑,消除网络中的环路,避 ...