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

Windows env can not find openssl command #102

Closed
kanokith opened this issue May 18, 2023 · 4 comments
Closed

Windows env can not find openssl command #102

kanokith opened this issue May 18, 2023 · 4 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed wontfix This will not be worked on

Comments

@kanokith
Copy link

kanokith commented May 18, 2023

Describe the bug
My pc can not read certificate from file (Windows 11). But it works well on my Linux server.

2023-05-18 08_53_41 - PDF_-_Google_Chrome

I use an example code on the doc.

    try {
        $cert = new ManageCert;
        $cert->setPreservePfx() // If you need to preserve the PFX certificate file
             ->fromPfx($path, $password);
        dd($cert->getCert());
    } catch (\Throwable $th) {
        dd($th);
    }

What I do

  1. Looking similar issues and found this Openssl is not recognized #71

  2. Update openssl on my windows, it work correctly.
    2023-05-18 09_24_54 - Command_Prompt

  3. Check is openssl extension enable.
    2023-05-18 08_53_15 - PDF_-_Google_Chrome

  4. I try others command like php --version, composere --version from Process::fromShellCommandline($command);
    Got the same error "Process runtime error, reason: "'php, composer' is not recognized as an internal or external command,. . operable program or batch file.. . ""

Versions involved:

  • Laravel: 9.52
  • Laravel A1 Pdf Sign 1.0
  • Composer 2.5
@kanokith kanokith added bug Something isn't working help wanted Extra attention is needed labels May 18, 2023
@kanokith
Copy link
Author

Update.
PHP Function shell_exec work well with my PC. I can call open ssl from shell_exec command. I guess I have a problem with Class Symfony\Component\Process.

@kanokith
Copy link
Author

kanokith commented May 18, 2023

It's work when I use this code

        $command = 'openssl version';
        $process = Process::fromShellCommandline($command,null,[
            'PATH' => getenv("PATH")
          ]);
        $process->run();

2023-05-18 13_02_36 - PDF_-_Google_Chrome

@lsnepomuceno
Copy link
Owner

Hello @kanokith ,

I ran some tests on Windows 10 and 11 and had no problems running the package or OpenSSL.

I will add the Windows environment in the test pipeline to try to catch possible problems.

Once it's done, I'll update this issue with the results.

@lsnepomuceno
Copy link
Owner

I carried out several tests trying to simulate the case described in the issue, but I was unable to reproduce the problem.

In Windows environments (10 and 11) with OpenSSL installed and running, the application occurred normally and it was possible to sign documents using this package.

Therefore, I will consider this case as a problem in your environment since we do not have new cases and in all tests the signature occurred normally.

Repository owner locked as resolved and limited conversation to collaborators Jan 25, 2024
@lsnepomuceno lsnepomuceno added the wontfix This will not be worked on label Jan 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants