LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-02-2015, 05:14 PM   #1
HWDPlinux
Member
 
Registered: Mar 2014
Posts: 32

Rep: Reputation: Disabled
Https ssl error


ausearch -ts recent -m avc----
time->Wed Dec 2 15:15:43 2015
type=SYSCALL msg=audit(1449087343.148:192469): arch=c000003e syscall=2 success=no exit=-13 a0=7fffed886830 a1=80000 a2=0 a3=7f829f4ed2c1 items=0 ppid=1 pid=32688 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)
type=AVC msg=audit(1449087343.148:192469): avc: denied { read } for pid=32688 comm="httpd" name="blog_dworak-linux_com.crt" dev="xvda2" ino=17779477 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_ubject_r:user_home_t:s0 tclass=file

Is tcontext mean it will work with those contexts?
 
Old 12-02-2015, 07:00 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by HWDPlinux View Post
ausearch -ts recent -m avc----
time->Wed Dec 2 15:15:43 2015
type=SYSCALL msg=audit(1449087343.148:192469): arch=c000003e syscall=2 success=no exit=-13 a0=7fffed886830 a1=80000 a2=0 a3=7f829f4ed2c1 items=0 ppid=1 pid=32688 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)
type=AVC msg=audit(1449087343.148:192469): avc: denied { read } for pid=32688 comm="httpd" name="blog_dworak-linux_com.crt" dev="xvda2" ino=17779477 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_ubject_r:user_home_t:s0 tclass=file

Is tcontext mean it will work with those contexts?
Use code tags (see my signature) to make your output more readable.

This is a message from SELinux. scontext means source context, i.e. the context of the httpd. tcontext is target context; the context of the file or other resource the process wanted to access. In your case, it seems to be a certificate file named blog_dworak-linux_com.crt.

The usual SELinux setup only requires looking at the type part of the context, i.e. httpd_t and user_home_t. The standard SELinux rules don't allow an httpd_t process to access a user_home_t resource. To fix this, you have to change the type of the resource (chcon command) or the rules (semanage command).

There is also an setroubleshoot package (the precise name may vary) that provides suggestions in readable English, but I would search for instructions for configuring https on a system with SELinux (Centos or RHEL, perhaps?) and check your setup.

Last edited by berndbausch; 12-02-2015 at 07:02 PM.
 
1 members found this post helpful.
Old 12-03-2015, 01:05 PM   #3
HWDPlinux
Member
 
Registered: Mar 2014
Posts: 32

Original Poster
Rep: Reputation: Disabled
Code:
[root@ip-172-31-20-xxx certs]# chcon -t httpd_t blog_*
chcon: failed to change context of blog_dworak-linux_com.ca-bundle to unconfined_u:object_r:httpd_t:s0: Permission denied
chcon: failed to change context of blog_dworak-linux_com.crt to unconfined_u:object_r:httpd_t:s0: Permission denied
This is what I got when trying to change the type context.

EDIT:
Found a solution.
restorecon -RvF /etc/pki/

I mv'ed my files (which kept the original selinux context) to their respective locations instead of using cp. Thank you berndbausch!

Last edited by HWDPlinux; 12-03-2015 at 01:43 PM.
 
Old 12-03-2015, 01:42 PM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by HWDPlinux View Post
Code:
[root@ip-172-31-20-xxx certs]# chcon -t httpd_t blog_*
chcon: failed to change context of blog_dworak-linux_com.ca-bundle to unconfined_u:object_r:httpd_t:s0: Permission denied
chcon: failed to change context of blog_dworak-linux_com.crt to unconfined_u:object_r:httpd_t:s0: Permission denied
This is what I got when trying to change the type context.
httpd_t is a process context. You can't apply it to a file.

You need to read about SELinux and httpd. I don't have pointers ready, but there is plenty of good information on the internet. There should even be a man page that covers the subject; use apropos to find it.

For a quick fix or test, turn SELinux off with setenforce permissive, but be aware that this reduces the security of your system.

Last edited by berndbausch; 12-03-2015 at 01:43 PM.
 
Old 12-03-2015, 01:47 PM   #5
HWDPlinux
Member
 
Registered: Mar 2014
Posts: 32

Original Poster
Rep: Reputation: Disabled
Thanks berndbausch I finally got it. restorecon -RvF /etc/pki/ did the trick. Marked the thread as solved.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
https certication error , the page can not be loaded via https ust Linux - Server 2 11-21-2013 08:49 PM
[SOLVED] Error on SVN checkout: SSL handshake failed: SSL error: Key usage violation in certif jsaravana87 Linux - Server 3 05-07-2012 10:00 AM
iptables ssl (https) problem imo_lv Linux - Networking 5 08-08-2008 01:06 AM
https SSL Certificate Expired lothario Linux - Security 1 01-19-2005 09:42 PM
Apache2, SSL, HTTPS... KneeLess Debian 3 09-02-2004 09:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration