I'm having problems connecting to Curitiba prefecture using CURL.
Code
$tamanho = strlen($xml_envio);
$parametros = array(
'POST /Iss.NfseWebService/nfsews.asmx HTTP/1.1',
'Host: isscuritiba.curitiba.pr.gov.br',
'Content-Type: application/soap+xml;charset=utf-8',
"Content-length: $tamanho");
$oCurl = curl_init();
curl_setopt($oCurl, CURLOPT_CONNECTTIMEOUT, 1 );
curl_setopt($oCurl, CURLOPT_URL,$this->URLwebservice[$this->aplicativo]);
curl_setopt($oCurl, CURLOPT_PORT, 443);
curl_setopt($oCurl, CURLOPT_VERBOSE, 1);
curl_setopt($oCurl, CURLOPT_HEADER, 1); //retorna o cabeçalho de resposta
curl_setopt($oCurl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, 2); // verifica o host evita MITM
curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($oCurl, CURLOPT_SSLCERT, $this->certKEY); // cnpj_certKey.pem
curl_setopt($oCurl, CURLOPT_SSLKEY, $this->priKEY); // cnpj_privKey.pem
curl_setopt($oCurl, CURLOPT_POST, 1);
curl_setopt($oCurl, CURLOPT_POSTFIELDS, $xml_envio);
curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($oCurl, CURLOPT_HTTPHEADER, $parametros);
$xml = curl_exec($oCurl);
If you send the certificate without the certificate, the city replies that the certificate is missing, if you send the certificate back FORBIDDEN 403
.
Note: The certificate is valid and is not expired.