Create a self-signed certificate in python
I want to create a self-signed certificate in Python. I poked around a bit and found some places and other questions that basically say to import things from
OpenSSL. I'm familiar with openssl's command line utilities so I figured that sounds like a good place to start. However, when I
import OpenSSL I get
ImportError: No module named 'OpenSSL'. When I tried
pip install --user OpenSSL I got
No matching distribution found for OpenSSL
I am using
python3 version
3.5 on one machine and
3.7 on another machine. It doesn't matter if it's specifically openssl, just as long as it's secure and well maintained and capable of generating valid certs for TLSv1.2 and preferably also TLSv1.3
I guess I could go run
os.system('openssl ...') but I'd rather have it all in python or libraries instead of creating another process.
1 answer
- answered 2018-10-16 21:14 inetknght
The trouble was that I needed to install the
pyopenssllibrary.
pip install --user pyopensslwas needed rather than
pip install --user OpenSSL. After that,
import OpenSSLworked just fine.
It's rather frustrating that the library name and import name aren't the same!.
- Set header in python list()
How can I set header for a python list?
I'm currently doing it like this:
df = list() df.append('header1')
Just wondering if there's a better solution...
-!
- How to have topic directive show up in table of contents?
The topic directive (found here:) is said to be used as a "self-contained section".
How can I make the title of each topic box show up in the table of contents, like a normal section title would?
-
- SocketTimeoutException: connect timed out under proxy
I want to try connect to under my proxy but SocketTimeoutException has been occurred. I hope someone can help me to fix it or explain a reason for this problem. Thanks!
I set my proxy in user\AppData\Roaming\Subversion\servers file
public class TestConnection {
public static void main(String[] args) throws Exception { // Create a trust manager that does not validate certificate chains) { } } }; //(); con.setConnectTimeout(7000); Reader reader = new InputStreamReader(con.getInputStream()); while (true) { int ch = reader.read(); if (ch == -1) { break; } System.out.print((char) ch); } }
}
Exception in thread "main" java.net.SocketTimeoutException: connect timed out68) at sun.net.NetworkClient.doConnect(NetworkClient.java:175) at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at sun.net. at org.tmatesoft.svn.examples.repository.TestConnection.main(TestConnection.java:65)
- Enabling TLSv1.2 for Java Applets
Can anyone help me out in making Java Applets to use TLSv1.2 while making server side connections which runs strictly TLSv1.2
Below code seems not working, any help is appreciated
<APPLET archive="large_archive.jar" code="MyApplet" width="300" height="300"> <PARAM NAME="java_arguments" VALUE="-Dhttps.protocols=TLSv1.2"> </APPLET>
- how do I give the TLS1.2 parameter in the Oracle jdbc thin connection url
I would like to use the TLS1.2 while connecting to database. I am using odbc8.jar My current url is of the format:
jdbc:oracle:thin:@host:port/servicename
I am not having an oracle installed and I dont have the tnsnames.ora I just have the thin client. So I am not able to use this
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=IP)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=testdb)))
I am looking to add TLS1.2 to the shorter url above. Any ideas?