Skip to content

Unable to create customer: Facturapi\Exceptions\Facturapi_Exception: cURL error: SSL certificate problem: unable to get local issuer certificate in #16

@luisfayre

Description

@luisfayre

En Laravel genera

Unable to create customer: Facturapi\Exceptions\Facturapi_Exception: cURL error: SSL certificate problem: unable to get local issuer certificate in

para resolverlo ir a
vendor\facturapi\facturapi-php\src\Http\BaseClient.php

protected function execute_JSON_post_request( $url, $body ) {
		$headers[] = 'Authorization: Basic ' . $this->FACTURAPI_KEY;
		$headers[] = 'Content-Type: application/json';

		// initialize cURL and send POST data
		$ch = curl_init();
		curl_setopt( $ch, CURLOPT_POST, true );
		curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $body ) );
		curl_setopt( $ch, CURLOPT_URL, $url );
		curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );

Agregar
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );

		curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers );

		$output = curl_exec( $ch );

		$errno  = curl_errno( $ch );
		$error  = curl_error( $ch );
		$this->setLastStatusFromCurl( $ch );
		curl_close( $ch );
		if ( $errno > 0 ) {
			throw new Facturapi_Exception( 'cURL error: ' . $error );
		} else {
			return $output;
		}
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions