Skip to content

Implementing a simple example of client-server communication using TLS in Docker

License

Notifications You must be signed in to change notification settings

s1lver/rr-grpc-tls-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using gRPC with TLS in Roadrunner

Implementing a simple example of client-server communication using TLS in Docker in PHP

This example is based on https://github.com/spiral/roadrunner-grpc/tree/master/example/echo

Setup

Build the client part

make build-client

Build the server part

make build-server

Additional commands

Stop a running container with a server

make down-server

Stop a running container with a client

make down-client

Running container with a server

make start-server

Running container with a client

make start-client

Create certificates

docker exec -it client-php bash
mkcert --install
mkcert -client localhost 127.0.0.1 ::1 192.168.231.2
mkcert localhost 127.0.0.1 ::1 192.168.231.2
mkcert -CAROOT
cp /root/.local/share/mkcert/rootCA.pem ./rootCA.pem

Test connect

docker exec -it client-php php ping.php

or

docker exec -it client-php bash
php ping.php

Response

Status code: 0

Status details:

2022-06-21 13:44:39: PONG

About

Implementing a simple example of client-server communication using TLS in Docker

Topics

Resources

License

Stars

Watchers

Forks