Minishlink / web-push-php-example

An example for sending Web Push notifications, using web-push-php
MIT License
252 stars 89 forks source link

I can work on local perfect . But on real SSL site How can i get PublicKey using openssl #17

Closed alpertandogan closed 5 years ago

alpertandogan commented 5 years ago

How can i create '~88 chars', // (recommended) uncompressed public key P-256 encoded in Base64-URL

Centos 7.5 (Linux version 4.1.12-124.18.6.el7uek.x86_64 ) php 7.2.12 Apache 2.4

app.js

const applicationServerKey = "BCmti7Sc____????____EDIFXjKvD-ma-";

send_push_notification.php

'VAPID' => array( 'subject' => 'https://www.REALSERVER.com/', 'publicKey' => 'BCmti7Sc????4wuDycO3Ih4', 'privateKey' => 'HJweeF64L35gw????RNK8C_fPQ', // in the real world, this would be in a secret file

OPENSSL I have create for Apache 2.4 using openssl like

REALSERVER.key REALSERVER.crs REALSERVER.crt

openssl genrsa -des3 -out REALSERVER.key 2048 Password:xxxx

openssl req -new -key REALSERVER.key -out REALSERVER.csr -subj "/C=TR/ST=Istanbul/L=Istanbul/O=realserver/CN=realserver.com"

openssl rsa -in /var/www/ssl/REALSERVER.key -out /var/www/ssl/REALSERVER_nopassword.key

comes from SSL provider REALSERVER.crt

alpertandogan commented 5 years ago

I use site below to genarete key it works well But . I want to learn is it possible to user my real Public.key and private key using genarate keys. I also use Ardiuno httpssl md5 keys with difrent method. Because there a lot of keys .Android keys,site ssl keys,Ardiuno keys..web push keys.

https://tools.reactpwa.com/vapid

Minishlink commented 5 years ago

See https://github.com/web-push-libs/web-push-php#authentication-vapid

Please ask this type of questoins on StackOverflow or other more appropriate forum