Use TLS over transport for authentication of peer #714
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Run Examples | |
| on: | |
| push: | |
| branches: [ 'master', 'main', 'release/**' ] | |
| pull_request: | |
| branches: [ '*' ] | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| transport: [ 'tcp', 'shm', 'dma', 'tls', 'psk' ] | |
| asan: [ 'ASAN=1', 'ASAN=0' ] | |
| debug: [ '', 'DEBUG_VERBOSE=1' ] | |
| test: [ '', '--test' ] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@master | |
| # pull and build wolfssl | |
| - name: Checkout wolfssl | |
| uses: actions/checkout@master | |
| with: | |
| repository: wolfssl/wolfssl | |
| path: wolfssl | |
| - name: Set TLS Environment Variable | |
| run: | | |
| if [ "${{ matrix.transport }}" = "tls" ] || [ "${{ matrix.transport }}" = "psk" ]; then | |
| echo "TLS=1" >> $GITHUB_ENV | |
| else | |
| echo "TLS=0" >> $GITHUB_ENV | |
| fi | |
| # Build examples | |
| - name: Build POSIX server | |
| run: | | |
| if [ "${{ matrix.transport }}" = "dma" ]; then | |
| cd examples/posix/wh_posix_server && ${{ matrix.asan }} ${{ matrix.debug }} DMA=1 make -j WOLFSSL_DIR=../../../wolfssl | |
| else | |
| cd examples/posix/wh_posix_server && ${{ matrix.asan }} ${{ matrix.debug }} TLS=${{ env.TLS }} make -j WOLFSSL_DIR=../../../wolfssl | |
| fi | |
| - name: Build POSIX client | |
| run: | | |
| if [ "${{ matrix.transport }}" = "dma" ]; then | |
| cd examples/posix/wh_posix_client && ${{ matrix.asan }} ${{ matrix.debug }} DMA=1 make -j WOLFSSL_DIR=../../../wolfssl | |
| else | |
| cd examples/posix/wh_posix_client && ${{ matrix.asan }} ${{ matrix.debug }} TLS=${{ env.TLS }} make -j WOLFSSL_DIR=../../../wolfssl | |
| fi | |
| # Start the server in the background | |
| - name: Run POSIX server | |
| run: | | |
| cd examples/posix/wh_posix_server | |
| if [ "${{ matrix.transport }}" = "psk" ]; then | |
| echo "test_password" | ./Build/wh_posix_server.elf --type ${{ matrix.transport }} & | |
| else | |
| ./Build/wh_posix_server.elf --type ${{ matrix.transport }} & | |
| fi | |
| POSIX_SERVER_PID=$! | |
| echo "POSIX_SERVER_PID=$POSIX_SERVER_PID" >> $GITHUB_ENV | |
| # Run the client that connects to the server | |
| - name: Run POSIX client | |
| run: | | |
| cd examples/posix/wh_posix_client | |
| if [ "${{ matrix.transport }}" = "psk" ]; then | |
| echo "test_password" | ./Build/wh_posix_client.elf --type ${{ matrix.transport }} ${{ matrix.test }} | |
| else | |
| ./Build/wh_posix_client.elf --type ${{ matrix.transport }} ${{ matrix.test }} | |
| fi | |
| # Optional: Kill the server process if it doesn't exit on its own | |
| - name: Cleanup POSIX server | |
| if: always() | |
| run: kill $POSIX_SERVER_PID || true | |