G
G
Galdar Turin2019-02-13 11:07:36
PHP
Galdar Turin, 2019-02-13 11:07:36

Who knows how, through a php script, to implement a quick creation of a certificate\key for a client?

It is required to write a PHP script that will automatically create a certificate/key pair for the Client. The problem appears at the moment where you need to enter confirmation in the console, when executing the command: Knocks out the standard input:
exec('./easyrsa gen-req '.$nameClient.' nopass/');

spoiler
[email protected]:~/EasyRSA-3.0.5# php XXXXXXXXXX.php

Ignoring unknown command option: 'nopass/'
Generating a RSA private key
............................................................................................................+++++
......................................................................................................................................+++++
writing new private key to '/root/EasyRSA-3.0.5/pki/private/XXXXX.key.qnQWqYK39n'
Enter PEM pass phrase: (вот здесь нужно автоматически подставлять значение)

Now I use the composer require symfony/console library , but maybe there is another way to solve this problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2019-02-13
@Compolomus

https://github.com/EvilFreelancer/easyrsa-php
A friend of mine wrote

R
Rsa97, 2019-02-13
@Rsa97

Gives the correct error. The nopass option is written without a slash at the end.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question