C
C
checky2016-01-24 11:03:19
PHP
checky, 2016-01-24 11:03:19

What will change when installing an ssl certificate?

For example, there is a common form

<form method="post" action=""><input name="val" value="test"><input type="submit"></form>
which will pass val = test to the same page using the post method,
as I understand it, if there is an ssl certificate, along with this, the certificate key is also transmitted, which will be verified by the server to which the transfer
is being made it so that after installing the ssl certificate everything continues to function correctly?
2) what happens if the key does not fit?
3) can I send data to the page by adding ?val=test at the end of the address bar so that this value is considered by the script that receives the information from the $_POST array? - this is a general question, and also with regards to the case with ssl
4) what will change when passing through the GET method?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sumanai, 2016-01-24
@checky

Where are you going to put the certificate? If you install it on the server (https), then you will not see anything interesting from the PHP script. Just the protocol in the address will be https. About client certificates I will not tell, I do not know.
Point by point:
1) You need to change all links to downloaded files to use the https protocol, or use relative links
2) The web server checks the keys, it will not allow you to install public and private certificates that do not match each other. If the client sends erroneous data, then there will be a connection error, but this will not happen on a correctly working client.
3) If the script expects a value in the $_POST array, then no.
4) The transfer method and page address will change after sending.

O
Oleksandr, 2016-03-16
@Track77

I think it will come in handy
If you redirect to an https server, then the data transmitted via the POST request is deleted
. To prevent this from happening, add a line before the redirect
. That is, if there is a POST request, there will be no redirect, but the data will not be lost.

<IfModule mod_rewrite.c>
RewriteEngine On
# запретить перенаправление при запросе post
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question