Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
luisfayre opened this issue Jun 11, 2023 · 0 comments

Comments

@luisfayre
Copy link

luisfayre commented Jun 11, 2023

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;
		}
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant