Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
settingsd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
settingsd
Commits
dd0d4f5c
Commit
dd0d4f5c
authored
Apr 23, 2019
by
Никита Ефремов
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added ssl constructor for generating constants
parent
8189847c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
fmod_ssl.py
plugins/functions/fmod_ssl.py
+15
-7
No files found.
plugins/functions/fmod_ssl.py
View file @
dd0d4f5c
...
...
@@ -11,15 +11,9 @@ from os import path
SERVICE_NAME
=
"ssl"
SSL_METHODS_NAMESPACE
=
"ssl"
CERTS_DIR
=
config
.
value
(
SERVICE_NAME
,
"cert_dir"
)
CERT_NAME
=
'serv'
PEMFILE
=
path
.
join
(
CERTS_DIR
,
CERT_NAME
+
'.pem'
)
KEYFILE
=
path
.
join
(
CERTS_DIR
,
CERT_NAME
+
'.key'
)
CERTFILE
=
path
.
join
(
CERTS_DIR
,
CERT_NAME
+
'.crt'
)
CSRFILE
=
path
.
join
(
CERTS_DIR
,
CERT_NAME
+
'.csr'
)
CAFILE
=
path
.
join
(
CERTS_DIR
,
'ca.crt'
)
CAKEY
=
path
.
join
(
CERTS_DIR
,
'ca.key'
)
DAYS
=
3650
CA_SUBJECT
=
'/C=RU/ST=1/L=1/O=1/OU=1/CN=1/emailAddress=1'
CERT_SUBJECT
=
'/C=RU/ST=1/L=1/O=1/OU=1/CN={}/emailAddress=1'
...
...
@@ -28,6 +22,20 @@ CERT_SUBJECT = '/C=RU/ST=1/L=1/O=1/OU=1/CN={}/emailAddress=1'
##### Private classes #####
class
Ssl
(
service
.
FunctionObject
)
:
def
__init__
(
self
,
*
args
):
# setting up constants
global
CERTS_DIR
,
PEMFILE
,
KEYFILE
,
CERTFILE
,
CSRFILE
,
CAFILE
,
CAKEY
CERTS_DIR
=
config
.
value
(
SERVICE_NAME
,
"cert_dir"
)
PEMFILE
=
path
.
join
(
CERTS_DIR
,
CERT_NAME
+
'.pem'
)
KEYFILE
=
path
.
join
(
CERTS_DIR
,
CERT_NAME
+
'.key'
)
CERTFILE
=
path
.
join
(
CERTS_DIR
,
CERT_NAME
+
'.crt'
)
CSRFILE
=
path
.
join
(
CERTS_DIR
,
CERT_NAME
+
'.csr'
)
CAFILE
=
path
.
join
(
CERTS_DIR
,
'ca.crt'
)
CAKEY
=
path
.
join
(
CERTS_DIR
,
'ca.key'
)
super
()
.
__init__
(
*
args
)
### DBus methods ###
@service.functionMethod
(
SSL_METHODS_NAMESPACE
)
def
generateCertificate
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment