Skip to content

Create insecure request #33

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

Open
eldario opened this issue Mar 1, 2024 · 0 comments
Open

Create insecure request #33

eldario opened this issue Mar 1, 2024 · 0 comments

Comments

@eldario
Copy link

eldario commented Mar 1, 2024

Problem

I'm trying to enter the command on https://laravelshift.com/convert-curl-to-http

curl --insecure -X POST http://example.com -H 'User: AAA' -d '{"data":"some"}'

Result of this:

Http::withBody('{"data":"some"}')
    ->withHeaders([
        'User' => 'AAA',
    ])
    ->post('http://example.com');

Expected Result

Http::withBody('{"data":"some"}')
    ->withoutVerifying()
    ->withHeaders([
        'User' => 'AAA',
    ])
    ->post('http://example.com');

The same situation with the `-k flag

curl -k -X POST http://example.com -H 'User: AAA' -d '{"data":"some"}'

Result of this:
изображение

Expected Result

Http::withBody('{"data":"some"}')
    ->withoutVerifying()
    ->withHeaders([
        'User' => 'AAA',
    ])
    ->post('http://example.com');

From https://curl.se/docs/sslcerts.html

Tell libcurl to not verify the peer. With libcurl you disable this with curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE);

With the curl command line tool, you disable this with -k/--insecure.
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