Creating Selfsigned Certificate with an Existing Key
Most OpenSSL documentation out there only shows you how to create a new key and signs it with in single command. I wanted to use a self-signed in the interm while waiting for my third-party CA approve my certificate. I already had an existing key. Here is the command to create a self-signed certificate from an existing RSA key.
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality
Anya is LIVE right now
FREE
Free to watch • No registration required • HD streaming
Connecting to Mongo with a self signed CA on a JVM in Kubernetes
At $WORK, we're creating an internal platform on top of Kubernetes for developers to deploy their apps. Our Ops people have graciously provided us with Mongo clusters that all use certificates signed by a self-signed certificate authority. So, all our clients need to know about the self-signed CA in order to connect to Mongo. For Node or Python, it's possible to pass the self-signed CA file in the code running in the application.
But, things are a little more complicated for Java or Scala apps, because configuration of certificate authorities is done at the JVM level, not at the code level. And for an extra level of fun, we want to do it in Kubernetes, transparently to our developers, so they don't have to worry about it on their own.
err, wha? telling the JVM about our CA
First off, we had to figure out how to tell the JVM to use our CA. And luckily since all the JVM languages use the same JVM, it's the same steps for Scala, or Clojure, or whatever other JVM language you prefer. The native MongoDB Java driver docs tell us exactly what we need to do: use keytool to import the cert into a keystore that the JVM wants, and then use system properties to tell the JVM to use that keystore. The keytool command in the docs is:
$ keytool -importcert -trustcacerts -file <path to certificate authority file> \ -keystore <path to trust store> -storepass <password>
The path to the existing keystore that the JVM uses by default is $JAVA_HOME/jre/lib/security/cacerts, and its default password is changeit. So if you wanted to add your self signed CA to the existing keystore, it'd be something like
(Even this very first step had complications. Our self signed CA was a Version 1 cert with v3 extensions, and while no other language cared, keytool refused to create a keystore with it. We ended up having to create a new self-signed CA with the appropriate version. Some lucky googling led us to that conclusion, but of particular use was using openssl to examine the CA and check its versions and extensions:)
Since the default password is changeit, you may want to change it... but if you don't change it, you wouldn't have to specify the trustStorePassword system property.
handling this in kubernetes
The above steps aren't too complicated on their own. We just need to make sure we add our CA to the existing ones, and point the JVM towards our new and improved file. But, since we'll eventually need to rotate the self-signed CA, we can't just run keytool once and copy it everywhere. So, an initContainer it is! keytool is a java utility, and it's handily available on the openjdk:8u121-alpine image, which means we can make a initContainer that runs keytool for us dynamically, as part of our Deployment.
Since seeing the entire manifest at once doesn't necessarily make it easy to see what's going on, I'm going to show the key bits piece by piece. All of the following chunks of yaml belong to in the spec.template.spec object of a Deployment or Statefulset.
So, first things first, volumes: an empty volume called truststore which we'll put our new and improved keystore-with-our-ssca. Also, we'll need a volume for the self-signed CA itself. Our Ops provided it for us in a secret with a key ca.crt, but you can get it into your containers any way you want.
With the volumes in place, we need to set up init containers to do our keytool work. I assume (not actually sure) that we need to add our self-signed CA to the existing CAs, so we use one initContainer to copy the existing default cacerts file into our truststore volume, and another initContainer to run the keytool command. It's totally fine to combine these into one container, but I didn't feel like making a custom docker image with a shell script or having a super long command line. So:
Mount the truststore volume in the copy initContainer, grab the file cacerts file, and put it in our truststore volume. Note that while we'd like to use $JAVA_HOME in the copy initContainer, I couldn't figure out how to use environment variables in the command. Also, since we're using a tagged docker image, there is a pretty good guarantee that the filepath shouldn't change underneath us, even though it's hardcoded.
Next, the import step! We need to mount the self-signed CA into this container as well. Run the keytool command as described above, referencing our copied cacerts file in our truststore volume and passing in our ssCA.
Two things to note here: the -noprompt argument to keytool is mandatory, or else keytool will prompt for interaction, but of course the initContainer isn't running in a shell for someone to hit yes in. Also, the mountPaths for these volumes should be separate folders! I know Kubernetes is happy to overwrite existing directories when a volume mountPath clashes with a directory on the image, and since we have different data in our volumes, they can't be in the same directory. (...probably, I didn't actually check)
The final step is telling the JVM where our new and improved trust store is. My first idea was just to add args to the manifest and set the system property in there, but if the Dockerfile ENTRYPOINT is something like
which would pass the option to the jar instead of setting a system property. Plus, that wouldn't work at all if the ENTRYPOINT was a shell script or something that wasn't expecting arguments.
After some searching, StackOverflow taught us about the JAVA_OPTS and JAVA_TOOL_OPTIONS environment variables. We can append our trustStore to the existing value of these env vars, and we'd be good to go!
spec: template: spec: containers: - image: your-app-image env: # make sure not to overwrite this when composing the yaml - name: JAVA_OPTS value: -Djavax.net.ssl.trustStore=/ssca/truststore/cacerts volumeMounts: - name: truststore mountPath: /ssca/truststore
In our app that we use to construct the manifests, we check if the developer is already trying to set JAVA_OPTS to something, and make sure that we append to the existing value instead of overwriting it.
a conclusion of sorts
Uh, so that got kind of long, but the overall idea is more or less straightforward. Add our self-signed CA to the existing cacerts file, and tell the JVM to use it as the truststore. (Note that it's the trustStore option you want, not the keyStore!). The entire Deployment manifest all together is also available, if that sounds useful...
New Post has been published on http://www.python.tc/redhat-serverda-ssl-kurulumu/
Redhat Server'da SSL Kurulumu
Evet şimdi sizlere apache server a ssl kurulumunu göstericem bu ssl kendimiz yapacağımız için self-signed(kendinden imzalı ) diye geçer ücretsiz ama server a browser da ngrimeye çalıştığınzda şöyle bir şeyle karşılaşırlar:
şimdi nasıl kuracağımıza geçelim.İlk önce https://www.openssl.org/source/
bu siteye girip en güncel ssl i seçiyoruz sonrasında şu komutla
wget https://www.openssl.org/source/(indireceğiniz dosyanın adını yazıyoruz)
indirdikten sonra
tar -xzvf openssl-openssl-1.0.2l.tar.gz
yazarak arşivi çıkartıyoruz.
Daha sonra
cd openssl-1.0.2l dosyanın içine girip ./config
komutunu girerek biraz bekliyoruz.
make //daha sonra make install
komutlarını girip işlemleri bitirmesini bekliyoruz.Bu işlemler biraz uzun sürecektir.
sonrasında ssl sertifikası oluşturmak için pacahe dosyasımızın olduğu yere bir dosya oluşturuyoruz.
-days dan sonra gelen sayı kaç gün geçerli olduğunu -keyout tan sonra gelen key lerin nerede depolanacağını out ta setifika için gerekli şeylerin nerede depolanacağını gösteriyor.Bu komuttan sonra size ait bazı bilgiler istiyor onları dolduruyoruz.
Şimdi eski sertifika yerini değiştirmemiz gerekiyor artık ssl kullanıcaz çünkü.Onun için bir program yüklememiz gerekli mod_ssl onun için redhat için:
yum install mod_ssl
Şimdi ise https olması için iptables ayarlarından 443 portunu açmamız gerekiyor çünkü ssl 443 portunu dinleyerek çalışır. onun için:
vim /etc/sysconfig/iptables
ben vim kullanıyorum siz başka şeyler kullanarakta dosyada değişiklik yapabilirsiniz.
sonrasında şu satırı ekliyoruz:
-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
Daha sonra iptables restart atıyoruz.Sonrasında artık ssl sertifikamız yükleniyor tarayıcınızdan girip bakabilirsiniz.
Anfrage: Ich habe mir ownCloud auf einem Raspberry Pi installiert und möchte Status Emails über meinen eigenen Mailserver verschicken lassen. Leider klappt das nicht.
Lösung: Vermutlich hast du bei deinem eigenen Mailserver kein vollständig signiertes Zertifikat hinterlegt. Bei einem sogenannten “self-signed certificate” verweigert die Mailkomponenten von ownCloud den Dienst. Das kannst du mit folgenden Anpassungen ändern.
Solution: Are self-signed SSL certificates secure? #programming #solution #computers
Solution: Are self-signed SSL certificates secure? #programming #solution #computers
Are self-signed SSL certificates secure?
I want to have a secure connection, when I log into my webmail, phpMyAdmin, etc.
Therefore I signed my own SSL certificates with OpenSSL and told Apache to listen on port 443.
Is this in fact secure? Are all my passwords really sent through a safe and secure layer? What difference does it make, if I buy an SSL certificate from Verisignor sign my own one?…
Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
✓ Live Streaming✓ Interactive Chat✓ Private Shows✓ HD Quality
Anya is LIVE right now
FREE
Free to watch • No registration required • HD streaming
Cannot create self-signed SSL certificate with IIS 7
I’m trying to create a self-signed certificate from within the IIS 7 snap-in, with little luck. When prompted for a friendly name for the certificate, I type in the name, and click OK, but then I am shown:
There was an error while performing this operation. Details: Access is denied.
I am doing this while logged on with an account with full…
Resolved: Can I build my own Extended Validation SSL certificate? #answer #dev #solution
Resolved: Can I build my own Extended Validation SSL certificate? #answer #dev #solution
Can I build my own Extended Validation SSL certificate?
I can create by own CA and generate a self signed SSL certificate this way. But what does it take to make the browser show the certificate as being an “Extended Validation SSL certificate” ?
Can I create one myself and teach my browser to show it as EV?
Answer [by JamesRyan]: Can I build my own Extended Validation SSL certificate?
Resolved: IIS 7.5 Creating self signed certificates with validation date of more than a year #answer #it #dev
Resolved: IIS 7.5 Creating self signed certificates with validation date of more than a year #answer #it #dev
IIS 7.5 Creating self signed certificates with validation date of more than a year
I am creating self-signed SSL certificates in IIS 7.5 for internal use. The problem I have is that I want to create them so that they last for 10 years as it is only a dev environment.
I can’t see an option in IIS 7.5 where you can specify a the time the certificate is valid for. By default it creates certificates…