Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
zhifan huang
re6stnet
Commits
e803749b
Commit
e803749b
authored
Feb 17, 2015
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demo: generate certs that expire quickly to check renewal
parent
0234d059
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
demo/py
demo/py
+20
-0
re6st/registry.py
re6st/registry.py
+1
-1
No files found.
demo/py
View file @
e803749b
...
...
@@ -7,6 +7,26 @@ def __file__():
_parse_args
=
ArgumentParser
.
parse_args
ArgumentParser
.
parse_args
=
lambda
self
:
_parse_args
(
self
,
sys
.
argv
[
2
:])
if
1
:
# Check renewal of certificate.
from
random
import
randrange
from
re6st
import
registry
registry
.
RENEW_PERIOD
=
60
_createCertificate
=
registry
.
RegistryServer
.
createCertificate
def
createCertificate
(
self
,
client_prefix
,
*
args
):
self
.
cert_duration
=
200
if
int
(
client_prefix
,
2
)
==
7
else
\
randrange
(
10
,
60
)
**
2
try
:
return
_createCertificate
(
self
,
client_prefix
,
*
args
)
finally
:
del
self
.
cert_duration
registry
.
RegistryServer
.
createCertificate
=
createCertificate
# Simulate the case of a node that does
# not renew its certificate in time.
if
sys
.
argv
[
2
]
==
"@m7/re6stnet.conf"
:
registry
.
RENEW_PERIOD
=
-
30
return
os
.
path
.
join
(
sys
.
path
[
0
],
sys
.
argv
[
1
])
__file__
=
__file__
()
execfile
(
__file__
)
re6st/registry.py
View file @
e803749b
...
...
@@ -43,10 +43,10 @@ def rpc(f):
class
RegistryServer
(
object
):
peers
=
0
,
()
cert_duration
=
365
*
86400
def
__init__
(
self
,
config
):
self
.
config
=
config
self
.
cert_duration
=
365
*
86400
self
.
lock
=
threading
.
Lock
()
self
.
sessions
=
{}
self
.
sock
=
socket
.
socket
(
socket
.
AF_INET6
,
socket
.
SOCK_DGRAM
)
...
...
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