Return-Path: X-Original-To: apmail-qpid-users-archive@www.apache.org Delivered-To: apmail-qpid-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1855219470 for ; Mon, 7 Mar 2016 13:20:56 +0000 (UTC) Received: (qmail 81940 invoked by uid 500); 7 Mar 2016 13:20:55 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 81906 invoked by uid 500); 7 Mar 2016 13:20:55 -0000 Mailing-List: contact users-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@qpid.apache.org Delivered-To: mailing list users@qpid.apache.org Received: (qmail 81893 invoked by uid 99); 7 Mar 2016 13:20:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Mar 2016 13:20:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 34825C1B8A for ; Mon, 7 Mar 2016 13:20:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.802 X-Spam-Level: X-Spam-Status: No, score=-0.802 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id YWGgBoDyXSe4 for ; Mon, 7 Mar 2016 13:20:54 +0000 (UTC) Received: from mail-io0-f172.google.com (mail-io0-f172.google.com [209.85.223.172]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 7A9FA5F393 for ; Mon, 7 Mar 2016 13:20:53 +0000 (UTC) Received: by mail-io0-f172.google.com with SMTP id z76so28739528iof.3 for ; Mon, 07 Mar 2016 05:20:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=ft7Ks0loCl7TVXa5xShp53kQKwtwvI/JgWSipqAR0/Y=; b=HIxwP4YAvs2JJaG6XvvY+BfTUeNSXeTxKI8dyTDMommzm8kmXV7f9FzrReaxFEaNKr QM/hbtocBJlwEylFpqGQiIMPE5/I6qa2YHK0j/LiNWy9ZT1Cm4ehfx3TGfvauU2UHY1l mU9nJNYL/O4NM1wpoZTt8ro8R8Zh0Ejdvi2YuiAwdqZkm90/0YeZFZQUEa2TWdj56wyg Bee+/ox57mdIS8cKQ72L3NDpauN3YuSflg1rAzX2+E3C+x/IUWFp8bcLzalP9OPE08N7 krMk0hdUgfkeTeCBaaSNYdqbzZGcmd5wYuIiZh1XUf9zCaQDrYrbvAwLTmkKAYZsDNC4 NCcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ft7Ks0loCl7TVXa5xShp53kQKwtwvI/JgWSipqAR0/Y=; b=PW1Ki/pf2GJhHkEhmxshaygHAH7eHOYnD7a+CVw7NpYga7S185wceQ0I70+zi2rDvi IUzmxkI/+eFQEpHvBVH9DnUahbOuxfCATcxFRCyyVzt2zugQI8nNTaAyUIA5SSuryVXh xFzY3fO8swu7D+K2dvKUn9rSDUBf/o+b7kLON5x9ujHPjb2RXL1CIDOx0dq2Q7EOwW1L huSXku3lRdrI0QazAviJ0+jE4qm28bQM4GDH6/wWwwhK4EVI0rmDA6tFIOW7KuNMJtaj qj0GHduFPNqtS6wd0f2YY1OfT3luKe1MXW8AzESyF/8AvIyCTN7fhmdptaa8K6A8ktp/ pjXw== X-Gm-Message-State: AD7BkJJeBYyxEmrt/1CKTv1fLVDPZfFdcNZbqmfvOLY03j6yzh4Ti4hNtV247YrGiaR12hUJcm+hbDqh5KOY6g== X-Received: by 10.107.154.18 with SMTP id c18mr23976400ioe.169.1457356852439; Mon, 07 Mar 2016 05:20:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.41.234 with HTTP; Mon, 7 Mar 2016 05:20:13 -0800 (PST) From: Domen Vrankar Date: Mon, 7 Mar 2016 14:20:13 +0100 Message-ID: Subject: qpid cpp 0.34 get sender user Id on receiver side when using SSL authentication To: users@qpid.apache.org Content-Type: text/plain; charset=UTF-8 Hi, I'm using qpid C++ 0.34 both for broker and client. For authentication I'm using SSL without encryption. What I'm trying to do is to set user Id on every sent message: qpid_message.setUserId(connection_.getAuthenticatedUsername()); Reason for this is that I'd like to know on the receiver side who put the message in the exchange on the sending side. So now I have a few questions: First of I was experimenting with different nicknames for nss database and inside the certificate. Clients expect QPID_SSL_CERT_NAME to be set to nss database nickname while user Id in message has to be set to nickname inside of certificate (ACL file also has to contain the nickname that is located inside of the certificate). Is there a way to map/change the functionality so that nss database nickname would be used in all cases? Next I wanted to get user Id from connection (connection_.getAuthenticatedUsername()) but I always got "dummy" string. I traced that to SslConnector.cpp (getSecuritySettings function) where the string is hardcoded. Is there a way to get user id (certificate nickname) from this function? I tried to add this functionality myself: In SslSocket.cpp: std::string SslSocket::getCertNickname() const { std::string nickname; CERTCertificate* cert = SSL_LocalCertificate(nssSocket); if (cert) { nickname = cert->nickname; CERT_DestroyCertificate(cert); } return nickname; } There is already function getClientAuthId but on client side this returns server cert domain (which in my case is the same as gettingserver cert nickname - not certain if that is always the case)... In SslConnector.cpp function getSecuritySettings(): std::string nickname(socket.getCertNickname()); securitySettings.authid = (nickname.size() ? nickname + "@QPID" : "dummy"); //"dummy";//set to non-empty string to enable external authentication I'm not certain if this solution is OK/would be something that would be accepted by qpid devs? Also there is an issue that "@QPID" part is hardcoded and I'm not certain if this is always true. Maybe this part should be attached somewhere else (right before return of getAuthenticatedUsername()? Haven't checked how that code is connected)? My last question is if I am even on the right track and could this (knowing who sent the message on the receiving side from authentication data) be done any other simpler way that I missed? Thanks, Domen --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org