我正在尝试在RHEL5盒子上构建一个新版本的wireshark 1.10,目的是制作一个RPM,以便我支持的客户可以安装它.可能是其他人,如果我能找到一个地方来举办它.
WS1.10依赖于GTK +以及可用rpm包不支持的其他几个库.因此,我必须手工制作它们.GTK +需要pango(1.24.5)和cairo(1.8.8)支持.
从源代码构建并安装了较新版本的cairo之后,pango的./configure会出现以下错误
checking for CAIRO... yes
checking which cairo font backends could be used... none
configure: Disabling cairo support
Run Code Online (Sandbox Code Playgroud)
然后在最后./configure显示
configuration:
backends: X
Run Code Online (Sandbox Code Playgroud)
我可以通过查看/ usr/local/lib中的pkg_config来验证是否安装了Cairo.
我甚至看过pango config.log.但是我没有看到任何与我上面提到的消息有任何不同之处.
有哪些地方我应该寻找一个不那么简洁的错误信息?我对此进行故障排除有点不知所措.
我意识到这个问题有很多迭代。但我似乎无法正确理解答案。
我们已经使用类似于这篇文章的 oauth2 spring 服务器保护了我们的 rabbitmq 和 rest 端点。但它没有我们需要和想要的所有功能。所以我们想使用 Keycloak。通过转到新版本的 spring security 5.1 并指定 security.oauth2.resource.jwk.key-set-uri 并设置必要的依赖项和配置,我已经成功地保护了其余端点。
在尝试保护 RabbitMQ 时,我在检查消息头中的承载令牌时遇到了问题,因为 keycloak jwks 端点没有返回真正的 RSA 公钥。
RabbitMQ 使用CustomMessageListenerContainer从消息头中获取令牌,并使用 DefaultTokenServices 来检查令牌。
根据我的理解,使用密钥响应的端点是https://keycloak-server/auth/realms/my-realm/protocol/openid-connect/certs 在这个端点上执行 HttpGet,我得到的响应看起来像下列的
{
"keys": [{
"kid": "7JUbcl_96GNk2zNh4MAORuEz3YBuprXilmTXjm0gmRE",
"kty": "RSA",
"alg": "RS256",
"use": "sig",
"n": "nE9gEtzZvV_XisnAY8Hung399hwBM_eykZ9J57euboEsKra8JvDmE6w7SSrk-aTVjdNpjdzOyrFd4V7tFqev1vVJu8MJGIyQlbPv07MTsgYE5EPM4DxdQ7H6_f3vQjq0hznkFvC-hyCqUhxPTXM5NgvH86OekL2C170xnd50RLWw8FbrprP2oRjgBnXMAif1Dd8kwbKKgf5m3Ou0yTVGfsCRG1_LSj6gIEFglxNHvGz0RejoQql0rGMxcW3MzCvc-inF3FCafQTrG5eWHqp5xXEeMHz0JosQ7BcT8MVp9lHT_utiazhQ1uKZEb4uoYOyy6mDDkx-wExpZkOx76bk_Yu-N25ljY18hNllnV_8gVMkX46_vcc-eN3DRZGNJ-Asd_sZrjbXbAvBbKwVxZeOTaXiUdvl8O0G5xX2xPnS_WA_1U4b_V1t28WtnX4bqGlOejW2kkjLvNrpfQ5fnvLjkl9I2B16Mbh9nS0LJD0RR-AkBsv3rKEnMyEkW9UsfgYKLFKuH32x_CXi9uyvNDas_q8WS3QvYwAGEMRO_4uICDAqupCVb1Jcs9dvd1w-tUfj5MQOXB-srnQYf5DbFENTNM1PK390dIjdLJh4k2efCJ21I1kYw2Qr9lHI4X2peTinViaoOykykJiol6LMujUcfqaZ1qPKDy_UnpAwGg9NyFU",
"e": "AQAB"
}
]
}
Run Code Online (Sandbox Code Playgroud)
根据我的理解,密钥为“n”的字段应该是 RSA256 密钥。将它添加到 RSAVerifier 最终会得到一个错误:“Caused by: org.springframework.security.jwt.codec.InvalidBase64CharacterException: Bad Base64 input character decimal 95 in array position 2.”
但是,如果我登录到 keycloak 管理页面并进入领域设置-> 键并单击公钥,则弹出窗口会显示公钥减去“-----BEGIN PUBLIC KEY-----”和“- ----END PUBLIC KEY-----”页眉和页脚。硬编码这使一切正常。 …
在使用async_read和async_write时,我很难理解构建tcp客户端的正确方法.的例子似乎做一个async_read连接后,然后在处理程序ASYNC_WRITE.
在我的客户端和服务器的情况下,当客户端连接时,它需要检查要写入的消息队列并检查是否需要读取任何内容.我遇到困难的一件事就是了解这将如何异步工作.
我想象的是在async_connect处理程序中,如果sendQueue中有任何内容并且反复调用async_read,则线程将调用async_write.或者它应该检查在执行async_read之前是否有可读的内容?以下是我所说的一个例子.
void BoostTCPConnection::connectHandler()
{
setRunning(true);
while (isRunning())
{
//If send Queue has messages
if ( sendSize > 0)
{
//Calls to async_write
send();
}
boost::shared_ptr<std::vector<char> > sizeBuffer(new std::vector<char>(4));
boost::asio::async_read(socket_, boost::asio::buffer(data, size), boost::bind(&BoostTCPConnection::handleReceive, shared_from_this(), boost::asio::placeholders::error, sizeBuffer));
}
}
void BoostTCPConnection::handleReceive(const boost::system::error_code& error, boost::shared_ptr<std::vector<char> > sizeBuffer)
{
if (error)
{
//Handle Error
return;
}
size_t messageSize(0);
memcpy((void*)(&messageSize),(void*)sizeBuffer.data(),4);
boost::shared_ptr<std::vector<char> > message(new std::vector<char>(messageSize) );
//Will this create a race condition with other reads?
//Should a regular read happen here
boost::asio::async_read(socket_, …Run Code Online (Sandbox Code Playgroud) 我正在尝试在CentOS5上构建glib-2.36.4.我意识到升级到6会更明智,但由于客户的要求,这是不可能的.
我已经开始构建make了,我得到了以下错误.错误抱怨系统上不存在automake-1.13.但是,我构建了automake 1.14并安装了它.automake --version输出正确的版本.
我已经安装了一个yum列表 grep automake确保automake没有冲突的安装.
我试过谷歌搜索问题,但我无法想出任何东西.
make[4]: Entering directory `/home/tharper/glib-2.36.4/docs/reference/glib'
cd ../../.. && /bin/sh /home/tharper/glib-2.36.4/missing
automake-1.13 --gnu docs/reference/glib/Makefile
/home/tharper/glib-2.36.4/missing: line 81: automake-1.13: command not found
WARNING: 'automake-1.13' is missing on your system.
You should only need it if you modified 'Makefile.am' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'automake' program is part of the GNU Automake package:
<http://www.gnu.org/software/automake>
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
<http://www.gnu.org/software/autoconf>
<http://www.gnu.org/software/m4/>
<http://www.perl.org/>
make[4]: *** …Run Code Online (Sandbox Code Playgroud) 我有一个TCP客户端,在tcp套接字上调用常规连接工作正常.但是,对async_connect的调用永远不会触发处理程序.他们都使用几乎相同的代码.不同之处只是调用connect vs async_connect.
头
#ifndef TCPCLIENT_H
#define TCPCLIENT_H
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <boost/asio.hpp>
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
using boost::asio::ip::tcp;
//How about an interface for outputting errors
class BoostTCPDebugOutputInterface
{
public:
virtual void outputError(std::string& error)=0;
virtual void outputDebug(std::string& debug) = 0;
virtual void outputWarning(std::string& warning) = 0;
virtual void outputInfo(std::string& info) = 0;
};
class ShutdownCallback
{
public:
virtual void shutdown() = 0;
};
class BoostTCPConnection
: public boost::enable_shared_from_this<BoostTCPConnection>
{
public:
typedef boost::shared_ptr<BoostTCPConnection> Connection_ptr;
static Connection_ptr create(boost::asio::io_service& io_service, …Run Code Online (Sandbox Code Playgroud) 我在 spring security 中创建了一个示例资源服务器,其中包含一个包含WebSecurityConfigurerAdapter. spring-boot-starter-parent当我将库的 pom 中的父级从 2.0.8 更新到 2.1.2 时,spring-boot-maven-plugin我得到了可怕的repackage failed: Unable to find main class
2.0.8 版本,但spring-boot-starter-parent没有这个问题。
更新:执行 mvn clean 编译安装时会发生这种情况。可以在此处找到父版本为 2.0.8 的代码版本。只需将 pom.xml spring starter 父级从 2.0.8 更改为 2.1.2 即可。
我的图书馆 pom 如下。
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.utils.security</groupId>
<artifactId>resource-config</artifactId>
<version>1.0.1</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId> …Run Code Online (Sandbox Code Playgroud) 我继承了一些代码来移植到Android.我遇到问题的部分解析文本字符串并从中创建UTC日期.
当我运行继承的代码时,我得到错误java.text.ParseException:Unparseable date:"4/8/2009 06:00.0"(在偏移量14处)偏移量14指向十进制的毫秒数.我无法弄清楚为什么这是不正确的
异常错误总计
java.text.ParseException: Unparseable date: "4/8/2009 06:00.0" (at offset 14)
at java.text.DateFormat.parse(DateFormat.java:622)
at gbl.util.test.UTC_test.test2(UTC_test.java:32)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1661)
Run Code Online (Sandbox Code Playgroud)
有问题的代码看起来像
String date = "4/8/2009";
String time = "06:00.0";
SimpleDateFormat utcDateTime = new SimpleDateFormat("d/M/yy HH:mm:ss.SSS");
utcDateTime.setTimeZone(TimeZone.getTimeZone("UTC"));
utcDateTime.parse(date+" "+time);
Run Code Online (Sandbox Code Playgroud)
任何建议将非常感激.