亚洲精品国偷拍自产在线,亚洲国产欧美一区,亚洲综合色区无码一区爱av,国产曰批全过程免费视频好爽,国产成人无码精品久免费

Redis 6.0新特性----TLS 通道加密

Redis 6實(shí)現了通道加密,提高了redis的安全性。Redis作為緩存數據庫,里面很有可能緩存重要的敏感信息,所以支持tls通道加密還是很有必要的,當然敏感信息還是建議加密保存。

創(chuàng )建證書(shū)

mkdir -p tests/tls
openssl genrsa -out tests/tls/ca.key 2048
openssl req \
    -x509 -new -nodes -sha256 \
    -key tests/tls/ca.key \
    -days 3650 \
    -subj '/O=Redis Test/CN=Certificate Authority' \
    -out tests/tls/ca.crt
openssl genrsa -out tests/tls/redis.key 2048
openssl req \
    -new -sha256 \
    -key tests/tls/redis.key \
    -subj '/O=Redis Test/CN=Server' | \
    openssl x509 \
        -req -sha256 \
        -CA tests/tls/ca.crt \
        -CAkey tests/tls/ca.key \
        -CAserial tests/tls/ca.txt \
        -CAcreateserial \
        -days 365 \
        -out tests/tls/redis.crt
openssl dhparam -out tests/tls/redis.dh 2048

生成的證書(shū)如下圖所示:

image.png

編譯redis

使用下面命令編譯redis:

make BUILD_TLS=yes -j8

編譯結果如下:

image.png

啟動(dòng)服務(wù)端

使用下面命令啟動(dòng)redis服務(wù):

./src/redis-server --tls-port 6379 --port 0 \
        --tls-cert-file ./tests/tls/redis.crt \
        --tls-key-file ./tests/tls/redis.key \
        --tls-ca-cert-file ./tests/tls/ca.crt

結果如下:

image.png

客戶(hù)端鏈接

使用客戶(hù)端鏈接redis服務(wù):

./src/redis-cli --tls \
        --cert ./tests/tls/redis.crt \
        --key ./tests/tls/redis.key \
        --cacert ./tests/tls/ca.crt

結果如下:

image.png

也可以使用下面命令:

./src/redis-cli --tls --insecure

結果如下:

image.png



標 題:《Redis 6.0新特性----TLS 通道加密
作 者:zeekling
提 示:轉載請注明文章轉載自個(gè)人博客:浪浪山旁那個(gè)村

評論

  1. ??

  2. ??

  3. mark

  4. 靜態(tài)的可以用cdn的

  5. ??

  6. 學(xué)習了

  7. 學(xué)習了

  8. 想給博客套個(gè)緩存,奈何是靜態(tài)站!

  9. 技術(shù)文章,學(xué)習了。
    80% WordPress/Typecho,都是在講開(kāi)發(fā)

取消
亚洲精品国偷拍自产在线,亚洲国产欧美一区,亚洲综合色区无码一区爱av,国产曰批全过程免费视频好爽,国产成人无码精品久免费