How to create SSL_CTX in libssl 3.0 - libssl

According to libssl docs OpenSSL_add_all_algorithms is deprecated
The OpenSSL_add_all_algorithms(), OpenSSL_add_all_ciphers(), OpenSSL_add_all_digests(), and EVP_cleanup(), functions were deprecated in OpenSSL 1.1.0 by OPENSSL_init_crypto() and should not be used.
The question is what do I use in libssl newest version (3.0)
SSL_CTX * init_server_CTX()
{
SSL_METHOD * method;
SSL_CTX * ctx;
// how to create a new SSL_CTX
return ctx;
}

Related

testReport destinationDir is deprecated in gradle 7.4.2 so how to set it?

task<TestReport>("testReport") {
destinationDir = file("$buildDir/reports/allTests")
}
This is apparently deprecated, but the deprecation message doesn't make sense to me in this context. How am I actually supposed to set this value now?
/**
* Sets the directory to write the HTML report to.
*
* <strong>This method will be {#code #Deprecated} soon, please use {#link #getTestResults()} instead to access the new collection property.</strong>
*/
public void setDestinationDir(File destinationDir) {
DeprecationLogger.deprecateProperty(TestReport.class, "destinationDir").replaceWith("destinationDirectory")
.willBeRemovedInGradle8()
.withDslReference()
.nagUser();
getDestinationDirectory().set(destinationDir);
}
Please try like this.
Older version:
destinationDir = file("$buildDir/reports/tests/test")
With latest version:
getDestinationDirectory().set(file("$buildDir/reports/tests/test"))
It worked for me. Hope it'll work for you. Thanks

Laravel Call to Undefined Method Stripe\Plan::all()

This is my Laravel code but I think I might be using an older version of the Stripe function. That's why I'm getting this error, can anyone help me with this, please?
<?php
use Illuminate\Support\Facades\Cache;
use Stripe\Stripe;
class Plan
{
public static function getStripePlans()
{
// Set the API Key
Stripe::setApiKey(User::getStripeKey());
try {
// Fetch all the Plans and cache it
return Cache::remember('stripe.plans', 60 * 24, function () {
return \Stripe\Plan::all()->data;
});
} catch (\Exception $e) {
return false;
}
}
}
If you're using a version of the Stripe-PHP library < 2.0, you'd likely need to call Stripe_Plan::all() instead of \Stripe\Plan::all()
That said, it may be helpful to upgrade to a newer version of the Stripe PHP library to take advantage of more recent features https://github.com/stripe/stripe-php

ResultHandler.print() undefined

How come ResultHandler.print() is undefined? My Spring version is 3.2.5.RELEASE.
I am using it as
this.mockMvc.perform()...andDo(print());
print() is defined on MockMvcResultHandlers not on ResultHandler
From the documentation:
* static imports: MockMvcRequestBuilders.*, MockMvcResultHandlers.*
*
* mockMvc.perform(get("/form")).andDo(print());

Passing flyway.target and flyway.initVersion property to flywayMigrate gradle task results in cast exception error

Attempting to pass target property to FlywayMigration gradle task
gradle flywayMigrate -d -Pflyway.target='1.0.0'
or
gradle flywayMigrate -d -Pflyway.target=1.0.0
or
flyway {
url = 'jdbc:h2:file:target/foobar'
user = 'sa'
target = '1'}
fails with org.codehaus.groovy.runtime.typehandling.GroovyCastException
09:08:25.855 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '1.0.0' with class 'java.lang.String' to class 'com.googlecode.flyway.core.api.MigrationVersion'
Versions and platforms used:
'com.googlecode.flyway:flyway-gradle-plugin:2.2'
gradle -version
Gradle 1.6
Gradle build time: Tuesday 07 May 2013 9:12:14 AM
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.8.4 compiled on May 22 2012
Ivy: 2.2.0
JVM: 1.7.0_05 (Oracle Corporation 23.1-b03)
OS: Mac OS X 10.8.3 x86_64
It appears that this affects when one attempts to set two properties:
target
initVersion
On closer look both methods have overridden setters that accept different types as argument:
Sets the version to tag an existing schema with when executing init.
Parameters:
initVersion The version to tag an existing schema with when executing init. (default: 1)
740
741 public void setInitVersion(MigrationVersion initVersion) {
742 this.initVersion = initVersion;
743 }
Sets the version to tag an existing schema with when executing init.
Parameters:
initVersion The version to tag an existing schema with when executing init. (default: 1)
749
750 public void setInitVersion(String initVersion) {
751 this.initVersion = new MigrationVersion(initVersion);
752 }
However it appears that in the gradle target setting those priorities groovy is not matching correct override type when invoking setter on those two methods:
/**
* Sets this property on this Flyway instance if a value has been defined.
* #param flyway The Flyway instance.
* #param property The property to set.
*/
private void propSet(Flyway flyway, String property) {
def value = prop(property);
if (value != null) {
flyway[property] = value;
}
}
Issue 574 has been opened with Flyway
perhaps they can share some more insights on correct usage for setting above mentioned properties.

Error with undefined method CI_Loader::plugin()

I received the following error:
Call to undefined method CI_Loader::plugin() in C:\wamp\www\Code\application\libraries\DX_Auth.php on line 1233
on this code:
function captcha()
{
$this->ci->load->helper('url');
$this->ci->load->plugin('dx_captcha');
$captcha_dir = trim($this->ci->config->item('DX_captcha_path'), './');
Make sure you have moved any array values in application/config/autoload.php from $autoload[‘plugins’] to $autoload[‘helpers’] or you will notice stuff break.
This is the reference
Which version of CI are you using? Plugins has been removed since the 2.x and replaced with helper.
Try to use reCaptcha instead, it has a good library.
You're trying to load a plugin and plugins are not supported, if I remember it right since CI version 2. If that's the case (which seems to be) you need to convert your plugins into helpers.
I think you are trying to use an old version of DX_Auth on new version of CodeIgniter. Current version of DX_Auth is compatible with CI 2.x and is available on github.
A simple way to solve this problem is that you just put this code in your loader.php. The plugin its works. Go to System->Core->Loader.php.
/**
* Load Plugin
*
* This function loads the specified plugin.
*
* #access public
* #param array
* #return void
*/
function plugin($plugins = array())
{
if ( ! is_array($plugins))
{
$plugins = array($plugins);
}
foreach ($plugins as $plugin)
{
$plugin = strtolower(str_replace(EXT, '', str_replace('_pi', '', $plugin)).'_pi');
if (isset($this->_ci_plugins[$plugin]))
{
continue;
}
if (file_exists(APPPATH.'plugins/'.$plugin.EXT))
{
include_once(APPPATH.'plugins/'.$plugin.EXT);
}
else
{
if (file_exists(BASEPATH.'plugins/'.$plugin.EXT))
{
include_once(BASEPATH.'plugins/'.$plugin.EXT);
}
else
{
show_error('Unable to load the requested file: plugins/'.$plugin.EXT);
}
}
$this->_ci_plugins[$plugin] = TRUE;
log_message('debug', 'Plugin loaded: '.$plugin);
}
}
// --------------------------------------------------------------------
/**
* Load Plugins
*
* This is simply an alias to the above function in case the
* user has written the plural form of this function.
*
* #access public
* #param array
* #return void
*/
function plugins($plugins = array())
{
$this->plugin($plugins);
}

Resources