# # Library Interface: # # http_multipart_post_head # http_multipart_post_body # https_multipart_post # https_check_server_cert UAG="MolDynSub_CLI/${VERSION}" FORM_BOUNDARY="------------------MolDynSubCLI" X509_CERT_DIR=${X509_CERT_DIR:-/etc/grid-security/certificates} http_multipart_post_head () { local host=$1 local url=$2 local clen=$3 cat </dev/null $( http_multipart_post_head $host $url $body_len ) $( cat $body_f ) END return $? } https_check_server_cert () { local connect=$1 echo '' | openssl s_client -connect $connect -CApath ${X509_CERT_DIR} 2>/dev/null | grep 'Verify return code' | sed 's/^[^:]\+:\s\([0-9]\+\).*/\1/' }