JRuby / OpenSSL error when attempting to start Rails server: - ruby-on-rails

When I attempt to start my Rails server, I receive an error that reads:
OpenSSL::X509::StoreError: setting default path failed: Invalid keystore format
I suspect that my machine's keystore has somehow become corrupted. Does anyone know how I might go about resolving this issue?

Related

Trouble Enabling SSL on Fuseki Server

I'm hoping some of you may be able to help me with setting up SSL on my fuseki server. I've been battling with it for a few days now and am running out of possible solutions!
OS: RHEL 8.5 (Ootpa)
Fuseki: Version 4.2.0
Currently running as system service with:
ExecStart=/home/fuseki/apache-jena-fuseki-4.2.0/fuseki-server -v -tdb2 -update -config=/home/fuseki/fuseki_data/config.ttl
This is the manual I've been working with- https://jena.apache.org/documentation/fuseki2/fuseki-data-access-control.html
The following are the provided arguments to add in the startup sequence of fuseki-server.
–https=SETUP [Name of file for certificate details.]
& –httpsPort=PORT [The port for https. Default: 3043]
The --https argument names a file in JSON which includes the name of
the certificate file and password for the certificate.
The issue is that no matter how I phrase the arguments the process returns "fuseki-server[9469]: Unknown argument: https" in the journalctl logs.
I have tried -https=dir, --https=dir, & -httpsConf=dir (where dir is the directory to my cert_details.json file).
Based on the docs https should have native support but when I check fuseki-server -help there is no mention of an https argument. I have created a .jks from my cert, have set the correct file permissions, and have allowed 3043.
I have also located the block of code in fuseki that resolves the keystore and passwd from the .json file (which led me to try using -httpsConf=)
private void setHttpsCert(String filename) {
try {
JsonObject httpsConf = JSON.read(filename);
Path path = Path.of(filename).toAbsolutePath();
String keystore = httpsConf.get("keystore").getAsString().value();
// Resolve relative to the https setup file.
this.httpsKeystore = path.getParent().resolve(keystore).toString();
this.httpsKeystorePasswd = httpsConf.get("passwd").getAsString().value();
Not sure what I'm missing here. For what it's worth I'm a chemist and I definitely don't know java all that well so it very well could be me being stupid. Any suggestions/knowledge would be greatly appreciated.
there are two ways to get HTTPS+Fuseki:
The document referred to is for the jar file here: https://repo1.maven.org/maven2/org/apache/jena/jena-fuseki-server/4.2.0/jena-fuseki-server-4.2.0.jar, not the jar in the apache-jena-fuseki download. (BTW It does not have the UI.)
The one in the apache-jena-fuseki can be use HTTPS by using a Jetty configuration using --jetty=jetty.xml (https://www.eclipse.org/jetty/documentation/current/jetty-xml-config.html) -- example: https://github.com/apache/jena/blob/main/jena-fuseki2/examples/fuseki-jetty-https.xml (which will need modifying).

dart pub get CERTIFICATE_VERIFY_FAILED

I recently upgraded a project from 1.22.1 to 1.24.3. Subsequently, pub get has failed with either
Handshake error in client (OS Error:
CERTIFICATE_VERIFY_FAILED: self signed certificate in certificate chain(ssl_cert.c:345))
or
Handshake error in client (OS Error: error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED)
I've found similar threads about getting this error, but none of the solutions given in those threads seem to have fixed the issue. I ran pub --trace --verbosity all get as requested in those threads, output here
The less verbose output from Webstorm's console is
Working dir: C:\SGGDev\pearls\client
C:\DevTools\dart-sdk-1-24-3\bin\pub.bat get
Resolving dependencies...
Downloading uuid 0.5.3...
Downloading convert 2.0.1...
Downloading charcode 1.1.1...
Downloading crypto 2.0.2+1...
Downloading collection 1.14.3...
Downloading typed_data 1.1.5...
Downloading xml 2.6.0...
Downloading petitparser 1.6.1...
Downloading matcher 0.12.1+2...
Downloading stack_trace 1.8.0...
Downloading path 1.4.2...
Handshake error in client (OS Error:
CERTIFICATE_VERIFY_FAILED: self signed certificate in certificate chain(ssl_cert.c:345))
Process finished with exit code 1
Before I deleted the pub cache in appdata, a suggested solution, the same error was encountered almost immediately, after the first or second package.
Are you on Windows and using Kaspersky antivirus? I do not know all the technical details but this antivirus somehow affects the handshake. Disabling it should help.
Another workaround is to set the following environment variables:
PUB_HOSTED_URL=https://pub.flutter-io.cn
FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
The problem is also tracked here though I guess it's not a Dart SDK issue: https://github.com/dart-lang/sdk/issues/32131
For me the error was caused by my antivirus, i had to disable it to make Dart works.

Grails create-app unable to find valid certification path to requested target

I have setup grails 3.2.1. on windows JAVA_HOME and GRAILS_HOME is also set. verified by running grails -version and worked as expected.
But when issue command to create app, it always throw following error
"Error occurred running Grails CLI: unable to find valid certification path to requested target (Use --stacktrace to see the full trace)".
I tried it by disconnecting the internet and come to know its trying to connect to https://repo.grails.org
It seems that some certificates must be in JAVA_HOME/jre/lib/security/cacerts. with this thought I downloaded the SSL certificates from https://repo.grails.org by accessing the URL in browser.
same certificates imported in the JAVA_HOME/jre/lib/security/cacerts but still no change.
I could not find even a single related post over the internet.
when creating Grails app in Netbeans 8, I get the same error.
I don't know if I need any other valid certificate or there is any other problem.
Many thanks in advance for any help on this.
Use the "HTTP version" repository
Add the following configuration in USER_HOME/.grails/settings.groovy:
grails {
profiles {
repositories {
myRepo {
url = "http://repo.grails.org/grails/core/"
}
}
}
}
This problem is due to proxy server. i traced the network log. https://repo.grails.org resolves to proxy ip, I guess, because when i access the ip over htps in browser it presents me a certificate which really not in my keystore, when i add the same in my keystore an "host name mismatch error" is thrown instead of "unable to find valid certification path to requested target".
i tried to run this at my home pc and it worked though there are other issues but good to go with next step to work on Grails.
Thanks

ERROR Failed to start Neo Server

I have to use neo4j for my rails application.
So I started installing the neo4j server.I followed steps to install here on linux.
But when I run
./bin/neo4j console
It gives
ERROR Failed to start Neo Server on port [unknown port] Bad value 'conf/neo4j-http-logging.xml' for setting 'org.neo4j.server.http.log.config': HTTP log directory [/opt/neo4j-community-2.3.2/data/log] is not writeable.
org.neo4j.graphdb.config.InvalidSettingException: Bad value 'conf/neo4j-http-logging.xml' for setting 'org.neo4j.server.http.log.config': HTTP log directory [/opt/neo4j-community-2.3.2/data/log] is not writeable.
I am unable to start the neo4j server.Help me how to resolve it.
Thanks in advance.
The error message very clearly mentions the root cause:
HTTP log directory [/opt/neo4j-community-2.3.2/data/log] is not writeable.
So check file permissions and fix them so the user running neo4j can write to that directory.

Grails 3 - Gradle: Binary file gets corrupted during build on Heroku

I am trying to use the Google Rest API from a Heroku instance. I am having problems with my certificate file, but everything works as expected locally.
The certificate is a PKCS 12 certificate, and the exception I get is:
java.io.IOException: DerInputStream.getLength(): lengthTag=111, too
big.
I finally found the source of this problem. Somewhere along the way the certificate file is modified, locally it is 1732 bytes but on the Heroku instance it is 3024 bytes. But I have no idea when this occurs. I build with the same command locally (./gradlew stage) and execute the resulting jar with the same command.
The file is stored in grails-app/conf, I don't know any better place to put it. I am reading it using this.getClass().getClassLoader().getResourceAsStream(...)
I found similar problems can occur when using Maven with resource filtering. But I haven't found any signs of Grails or Gradle doing the same kind of resource filtering.
Does anyone have any clues about what this can be?

Resources