Received fatal alert: protocol_version

I get this error every time I build the project from a GitHub workflow. If I build it locally at my site, this won’t happen. The whole thing runs on a nexus installed on my server. The server accepts TLSv1.2 and TLSv1.3 requests.

Workflow
name: Gradle CI

on: [push]

jobs:
build:
name: Test for ${{ matrix.java }}
runs-on: ubuntu-latest

strategy:
  matrix:
    java: [ 8, 9, 10, 11, 12, 13, 14 ]

steps:
  - uses: actions/checkout@v2

  - name: Set up JDK ${{ matrix.java }}
    uses: actions/setup-java@v1
    with:
      java-version: ${{ matrix.java }}
      architecture: x64

  - name: Grant execute permission for gradlew
    run: chmod +x gradlew

  - name: Build with gradlew
    run: ./gradlew -Dhttps.protocols=TLSv1.2 build