Skip to content

Commit 4f59efa

Browse files
committed
Exploratory executions
1 parent 0148643 commit 4f59efa

File tree

3 files changed

+27
-18
lines changed

3 files changed

+27
-18
lines changed

.github/workflows/main.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,15 @@ jobs:
2828
- name: Build plugin
2929
run: bundle exec rake build
3030

31+
- run: id
32+
- run: sudo id
33+
- run: ls -dl /usr/lib /usr/lib/ssl /usr/lib/ssl/cert.pem
34+
3135
- name: Run tests
3236
run: bundle exec rake test
3337

38+
- run: ls -l /tmp
39+
3440
- name: Capture version
3541
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
3642

lib/fluent/plugin/out_scalyr.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ def write(chunk)
209209
$log.warn e.message
210210
$log.warn "Discarding buffer chunk without retrying or logging to <secondary>"
211211
rescue Scalyr::Client4xxError => e
212-
$log.warn "4XX status code received for request #{index + 1}/#{requests.size}. Discarding buffer without retrying or logging.\n\t#{response.code} - #{e.message}\n\tChunk Size: #{chunk.size}\n\tLog messages this request: #{request[:record_count]}\n\tJSON payload size: #{request[:body].bytesize}\n\tSample: #{request[:body][0, 1024]}..."
212+
x = Net::HTTP.new("google.com", 443)
213+
x.use_ssl = true
214+
$log.warn "#{x.ca_file} #{x.ca_path} 4XX status code received for request #{index + 1}/#{requests.size}. Discarding buffer without retrying or logging.\n\t#{response.code} - #{e.message}\n\tChunk Size: #{chunk.size}\n\tLog messages this request: #{request[:record_count]}\n\tJSON payload size: #{request[:body].bytesize}\n\tSample: #{request[:body][0, 1024]}..."
213215
end
214216
}
215217
rescue JSON::GeneratorError

test/test_ssl_verify.rb

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,28 @@ def test_bad_ssl_certificates
6767
end
6868

6969
def test_bad_system_ssl_certificates
70-
`sudo mv #{OpenSSL::X509::DEFAULT_CERT_FILE} /tmp/system_cert.pem`
71-
`sudo mv #{OpenSSL::X509::DEFAULT_CERT_DIR} /tmp/system_certs`
70+
# `sudo mv #{OpenSSL::X509::DEFAULT_CERT_FILE} /tmp/system_cert.pem`
71+
# `sudo mv #{OpenSSL::X509::DEFAULT_CERT_DIR} /tmp/system_certs`
7272

73-
begin
74-
d = create_driver %(
75-
api_write_token test_token
76-
)
73+
# begin
74+
d = create_driver %(
75+
api_write_token test_token
76+
ssl_ca_bundle_path '/non/existent'
77+
)
7778

78-
d.run(default_tag: "test") do
79-
time = event_time("2015-04-01 10:00:00 UTC")
80-
d.feed(time, {"a" => 1})
79+
d.run(default_tag: "test") do
80+
time = event_time("2015-04-01 10:00:00 UTC")
81+
d.feed(time, {"a" => 1})
8182

82-
logger = flexmock($log)
83-
logger.should_receive(:warn).once.with(/certificate verification failed/i)
84-
logger.should_receive(:warn).once.with(/certificate verify failed/i)
85-
logger.should_receive(:warn).once.with(/discarding buffer/i)
86-
end
87-
ensure
88-
`sudo mv /tmp/system_certs #{OpenSSL::X509::DEFAULT_CERT_DIR}`
89-
`sudo mv /tmp/system_cert.pem #{OpenSSL::X509::DEFAULT_CERT_FILE}`
83+
logger = flexmock($log)
84+
logger.should_receive(:warn).once.with(/certificate verification failed/i)
85+
logger.should_receive(:warn).once.with(/certificate verify failed/i)
86+
logger.should_receive(:warn).once.with(/discarding buffer/i)
9087
end
88+
# ensure
89+
# `sudo mv /tmp/system_certs #{OpenSSL::X509::DEFAULT_CERT_DIR}`
90+
# `sudo mv /tmp/system_cert.pem #{OpenSSL::X509::DEFAULT_CERT_FILE}`
91+
# end
9192
end
9293

9394
def test_hostname_verification

0 commit comments

Comments
 (0)