ssl – Netcat script for testing HTTP methods with HTTPS

I use this script to test which methods are enabled on a server:

#! / bin / bash

for web service method in GET POST PUT DELETE TRACE CONNECT OPTIONS PROPFIND COPY MOVE LOCK MKCOL;

do
printf "$ webservmethod";
printf "$ webservmethod / HTTP / 1.1  nHost: $ 1  n  n" | nc -q 1 $ 1 80 | grep "HTTP / 1.1"

done

I use ./script.sh test-url.com,
It does not work with a site using HTTPS.

Get HTTP / 1.1 400 a bad request

Is there a way to do this? Should I somehow use OpenSSL?